<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Compile Splats Stage</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
		<meta name="viewport" content="width=device-width initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="Content-Language" content="en-gb">

<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script>
function togglePopup(material_id) {
  var popup = document.getElementById(material_id);
  popup.classList.toggle("show");
}
</script>

<link href="../docs-assets/Popups.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script>
MathJax = {
	tex: {
		inlineMath: '$', '$'], ['\\(', '\\)'
	},
	svg: {
		fontCache: 'global'
	}
};
</script>
<script type="text/javascript" id="MathJax-script" async
	src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js">
</script>

<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
		
	</head>
	<body class="commentary-font">
		<nav role="navigation">
		<h1><a href="../index.html"><img src="../docs-assets/Inform.png" height=72> </a></h1>
<ul><li><a href="../index.html">home</a></li>
</ul><h2>Compiler</h2><ul>
<li><a href="../structure.html">structure</a></li>
<li><a href="../inbuildn.html">inbuild</a></li>
<li><a href="../inform7n.html">inform7</a></li>
<li><a href="../intern.html">inter</a></li>
<li><a href="../services.html">services</a></li>
<li><a href="../secrets.html">secrets</a></li>
</ul><h2>Other Tools</h2><ul>
<li><a href="../inblorbn.html">inblorb</a></li>
<li><a href="../inform6.html">inform6</a></li>
<li><a href="../inpolicyn.html">inpolicy</a></li>
</ul><h2>Resources</h2><ul>
<li><a href="../extensions.html">extensions</a></li>
<li><a href="../kits.html">kits</a></li>
</ul><h2>Repository</h2><ul>
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=0> github</a></li>
</ul><h2>Related Projects</h2><ul>
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=0> inweb</a></li>
<li><a href="https://github.com/ganelson/intest"><img src="../docs-assets/github.png" height=0> intest</a></li>
</ul>
		</nav>
		<main role="main">
		<!-- Weave of 'Compile Splats Stage' generated by inweb -->
<div class="breadcrumbs">
    <ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../intern.html">Inter Modules</a></li><li><a href="index.html">pipeline</a></li><li><a href="index.html#3">Chapter 3: Assimilation</a></li><li><b>Compile Splats Stage</b></li></ul></div>
<p class="purpose">To replace each splat node with a sequence of pure Inter nodes having the same meaning, thus purging the tree of all raw I6 syntax entirely.</p>

<ul class="toc"><li><a href="3-css.html#SP1">&#167;1. Basic idea</a></li><li><a href="3-css.html#SP4_1">&#167;4.1. How OrigSource definitions are assimilated</a></li><li><a href="3-css.html#SP4_2">&#167;4.2. How definitions are assimilated</a></li><li><a href="3-css.html#SP4_3">&#167;4.3. How functions are assimilated</a></li><li><a href="3-css.html#SP5">&#167;5. Inform 6 annotations</a></li><li><a href="3-css.html#SP6">&#167;6. Plumbing</a></li><li><a href="3-css.html#SP8">&#167;8. Inform 6 expressions in constant context</a></li><li><a href="3-css.html#SP13">&#167;13. Delegating the work of compiling function bodies</a></li></ul><hr class="tocbar">

<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. Basic idea.</b>Assimilation is a multi-stage process, but really this stage is the heart of it.
We expect that <span class="extract"><span class="extract-syntax">resolve-conditional-compilation</span></span> has already run, so that the
splats in the tree represent directives which all have definite effect. With
the conditional compilation splats gone, we are left with these:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">ARRAY_PLM</span><span class="plain-syntax">         </span><span class="identifier-syntax">ATTRIBUTE_PLM</span><span class="plain-syntax">     </span><span class="identifier-syntax">CONSTANT_PLM</span><span class="plain-syntax">      </span><span class="identifier-syntax">DEFAULT_PLM</span>
<span class="identifier-syntax">FAKEACTION_PLM</span><span class="plain-syntax">    </span><span class="identifier-syntax">GLOBAL_PLM</span><span class="plain-syntax">        </span><span class="identifier-syntax">OBJECT_PLM</span><span class="plain-syntax">        </span><span class="identifier-syntax">PROPERTY_PLM</span>
<span class="identifier-syntax">ROUTINE_PLM</span><span class="plain-syntax">       </span><span class="identifier-syntax">STUB_PLM</span><span class="plain-syntax">          </span><span class="identifier-syntax">VERB_PLM</span><span class="plain-syntax">          </span><span class="identifier-syntax">ORIGSOURCE_PLM</span>
</pre>
<p class="commentary">And we must turn those into splatless Inter code with the same effect. In some
cases, notably <span class="extract"><span class="extract-syntax">ROUTINE_PLM</span></span> which contains an entire Inform 6-notation
function definition, that is quite a lot of work.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">CompileSplatsStage::create_pipeline_stage</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">CompileSplatsStage::create_pipeline_stage</span></span>:<br/>Parsing Pipelines - <a href="2-pp.html#SP10">&#167;10</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">void</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><a href="2-pp.html#SP3" class="function-link"><span class="function-syntax">ParsingPipelines::new_stage</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"compile-splats"</span><span class="plain-syntax">, </span><a href="3-css.html#SP2" class="function-link"><span class="function-syntax">CompileSplatsStage::run</span></a><span class="plain-syntax">, </span><span class="constant-syntax">NO_STAGE_ARG</span><span class="plain-syntax">, </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>&#167;2. </b>We divide the task up into three traverses:
</p>

<ul class="items"><li>(1) <span class="extract"><span class="extract-syntax">PROPERTY_PLM</span></span>, <span class="extract"><span class="extract-syntax">ATTRIBUTE_PLM</span></span>, <span class="extract"><span class="extract-syntax">ROUTINE_PLM</span></span>, <span class="extract"><span class="extract-syntax">STUB_PLM</span></span>;
</li><li>(2) <span class="extract"><span class="extract-syntax">DEFAULT_PLM</span></span>, <span class="extract"><span class="extract-syntax">CONSTANT_PLM</span></span>, <span class="extract"><span class="extract-syntax">FAKEACTION_PLM</span></span>, <span class="extract"><span class="extract-syntax">OBJECT_PLM</span></span>, <span class="extract"><span class="extract-syntax">VERB_PLM</span></span>, <span class="extract"><span class="extract-syntax">ARRAY_PLM</span></span>;
</li><li>(3) <span class="extract"><span class="extract-syntax">GLOBAL_PLM</span></span>.
</li></ul>
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">CompileSplatsStage::run</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">CompileSplatsStage::run</span></span>:<br/><a href="3-css.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">pipeline_step</span><span class="plain-syntax"> *</span><span class="identifier-syntax">step</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">I6Errors::reset_count</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">compile_splats_state</span><span class="plain-syntax"> </span><span class="identifier-syntax">css</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP2_1" class="named-paragraph-link"><span class="named-paragraph">Initialise the CS state</span><span class="named-paragraph-number">2.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax"> = </span><span class="identifier-syntax">step</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">ephemera</span><span class="plain-syntax">.</span><span class="element-syntax">tree</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">InterTree::traverse</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><a href="3-css.html#SP4" class="function-link"><span class="function-syntax">CompileSplatsStage::visitor1</span></a><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">css</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">SPLAT_IST</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">InterTree::traverse</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><a href="3-css.html#SP4" class="function-link"><span class="function-syntax">CompileSplatsStage::visitor2</span></a><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">css</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">I6Errors::clear_current_location</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">errors_found</span><span class="plain-syntax"> = </span><a href="3-css.html#SP14" class="function-link"><span class="function-syntax">CompileSplatsStage::function_bodies</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">css</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">errors_found</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">InterTree::traverse</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><a href="3-css.html#SP4" class="function-link"><span class="function-syntax">CompileSplatsStage::visitor3</span></a><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">css</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">SPLAT_IST</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">I6Errors::clear_current_location</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">I6Errors::errors_occurred</span><span class="plain-syntax">()) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP3" class="paragraph-anchor"></a><b>&#167;3. </b>During this process, the following state is shared across all three traverses:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">typedef</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">compile_splats_state</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">pipeline_step</span><span class="plain-syntax"> *</span><span class="identifier-syntax">from_step</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">no_assimilated_actions</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">no_assimilated_directives</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">linked_list</span><span class="plain-syntax"> *</span><span class="identifier-syntax">function_bodies_to_compile</span><span class="plain-syntax">; </span><span class="comment-syntax"> of </span><span class="extract"><span class="extract-syntax">function_body_request</span></span>
<span class="plain-syntax">} </span><span class="reserved-syntax">compile_splats_state</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>The structure compile_splats_state is private to this section.</li></ul>
<p class="commentary firstcommentary"><a id="SP2_1" class="paragraph-anchor"></a><b>&#167;2.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Initialise the CS state</span><span class="named-paragraph-number">2.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">css</span><span class="plain-syntax">.</span><span class="element-syntax">from_step</span><span class="plain-syntax"> = </span><span class="identifier-syntax">step</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">css</span><span class="plain-syntax">.</span><span class="element-syntax">no_assimilated_actions</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">css</span><span class="plain-syntax">.</span><span class="element-syntax">no_assimilated_directives</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">css</span><span class="plain-syntax">.</span><span class="element-syntax">function_bodies_to_compile</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NEW_LINKED_LIST</span><span class="plain-syntax">(</span><span class="reserved-syntax">function_body_request</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP2">&#167;2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4" class="paragraph-anchor"></a><b>&#167;4. </b>The three traverse functions share a great deal of their code, in fact. Note
that we set the assimilation package to be the module containing whatever splat
is being compiled.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">CompileSplatsStage::visitor1</span><button class="popup" onclick="togglePopup('usagePopup3')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup3">Usage of <span class="code-font"><span class="function-syntax">CompileSplatsStage::visitor1</span></span>:<br/><a href="3-css.html#SP2">&#167;2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">inter_tree_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="reserved-syntax">void</span><span class="plain-syntax"> *</span><span class="identifier-syntax">state</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">compile_splats_state</span><span class="plain-syntax"> *</span><span class="identifier-syntax">css</span><span class="plain-syntax"> = (</span><span class="reserved-syntax">compile_splats_state</span><span class="plain-syntax"> *) </span><span class="identifier-syntax">state</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">pipeline_step</span><span class="plain-syntax"> *</span><span class="identifier-syntax">step</span><span class="plain-syntax"> = </span><span class="identifier-syntax">css</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">from_step</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Inode::is</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="identifier-syntax">PACKAGE_IST</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pack</span><span class="plain-syntax"> = </span><span class="identifier-syntax">PackageInstruction::at_this_head</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ptype</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterPackage::type</span><span class="plain-syntax">(</span><span class="identifier-syntax">pack</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">InterSymbol::identifier</span><span class="plain-syntax">(</span><span class="identifier-syntax">ptype</span><span class="plain-syntax">), </span><span class="identifier-syntax">I</span><span class="string-syntax">"_module"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">step</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">pipeline</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">ephemera</span><span class="plain-syntax">.</span><span class="element-syntax">assimilation_modules</span><span class="plain-syntax">[</span><span class="identifier-syntax">step</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">tree_argument</span><span class="plain-syntax">] = </span><span class="identifier-syntax">pack</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Inode::is</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="identifier-syntax">SPLAT_IST</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">directive</span><span class="plain-syntax"> = </span><span class="identifier-syntax">SplatInstruction::plm</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">directive</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">PROPERTY_PLM:</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">ATTRIBUTE_PLM:</span>
<span class="plain-syntax">                </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2" class="named-paragraph-link"><span class="named-paragraph">Assimilate definition</span><span class="named-paragraph-number">4.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">ROUTINE_PLM:</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">STUB_PLM:</span>
<span class="plain-syntax">                </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_3" class="named-paragraph-link"><span class="named-paragraph">Assimilate routine</span><span class="named-paragraph-number">4.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">ORIGSOURCE_PLM:</span>
<span class="plain-syntax">                </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_1" class="named-paragraph-link"><span class="named-paragraph">Assimilate origsource directive</span><span class="named-paragraph-number">4.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">CompileSplatsStage::visitor2</span><button class="popup" onclick="togglePopup('usagePopup4')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup4">Usage of <span class="code-font"><span class="function-syntax">CompileSplatsStage::visitor2</span></span>:<br/><a href="3-css.html#SP2">&#167;2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">inter_tree_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="reserved-syntax">void</span><span class="plain-syntax"> *</span><span class="identifier-syntax">state</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">compile_splats_state</span><span class="plain-syntax"> *</span><span class="identifier-syntax">css</span><span class="plain-syntax"> = (</span><span class="reserved-syntax">compile_splats_state</span><span class="plain-syntax"> *) </span><span class="identifier-syntax">state</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">pipeline_step</span><span class="plain-syntax"> *</span><span class="identifier-syntax">step</span><span class="plain-syntax"> = </span><span class="identifier-syntax">css</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">from_step</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Inode::is</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="identifier-syntax">PACKAGE_IST</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pack</span><span class="plain-syntax"> = </span><span class="identifier-syntax">PackageInstruction::at_this_head</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ptype</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterPackage::type</span><span class="plain-syntax">(</span><span class="identifier-syntax">pack</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">InterSymbol::identifier</span><span class="plain-syntax">(</span><span class="identifier-syntax">ptype</span><span class="plain-syntax">), </span><span class="identifier-syntax">I</span><span class="string-syntax">"_module"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">step</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">pipeline</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">ephemera</span><span class="plain-syntax">.</span><span class="element-syntax">assimilation_modules</span><span class="plain-syntax">[</span><span class="identifier-syntax">step</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">tree_argument</span><span class="plain-syntax">] = </span><span class="identifier-syntax">pack</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Inode::is</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="identifier-syntax">SPLAT_IST</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">directive</span><span class="plain-syntax"> = </span><span class="identifier-syntax">SplatInstruction::plm</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">directive</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">ARRAY_PLM:</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">DEFAULT_PLM:</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">CONSTANT_PLM:</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">FAKEACTION_PLM:</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">OBJECT_PLM:</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">VERB_PLM:</span>
<span class="plain-syntax">                </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2" class="named-paragraph-link"><span class="named-paragraph">Assimilate definition</span><span class="named-paragraph-number">4.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">CompileSplatsStage::visitor3</span><button class="popup" onclick="togglePopup('usagePopup5')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup5">Usage of <span class="code-font"><span class="function-syntax">CompileSplatsStage::visitor3</span></span>:<br/><a href="3-css.html#SP2">&#167;2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">inter_tree_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="reserved-syntax">void</span><span class="plain-syntax"> *</span><span class="identifier-syntax">state</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">compile_splats_state</span><span class="plain-syntax"> *</span><span class="identifier-syntax">css</span><span class="plain-syntax"> = (</span><span class="reserved-syntax">compile_splats_state</span><span class="plain-syntax"> *) </span><span class="identifier-syntax">state</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">pipeline_step</span><span class="plain-syntax"> *</span><span class="identifier-syntax">step</span><span class="plain-syntax"> = </span><span class="identifier-syntax">css</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">from_step</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Inode::is</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="identifier-syntax">PACKAGE_IST</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pack</span><span class="plain-syntax"> = </span><span class="identifier-syntax">PackageInstruction::at_this_head</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ptype</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterPackage::type</span><span class="plain-syntax">(</span><span class="identifier-syntax">pack</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">InterSymbol::identifier</span><span class="plain-syntax">(</span><span class="identifier-syntax">ptype</span><span class="plain-syntax">), </span><span class="identifier-syntax">I</span><span class="string-syntax">"_module"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">step</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">pipeline</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">ephemera</span><span class="plain-syntax">.</span><span class="element-syntax">assimilation_modules</span><span class="plain-syntax">[</span><span class="identifier-syntax">step</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">tree_argument</span><span class="plain-syntax">] = </span><span class="identifier-syntax">pack</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Inode::is</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="identifier-syntax">SPLAT_IST</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">directive</span><span class="plain-syntax"> = </span><span class="identifier-syntax">SplatInstruction::plm</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">directive</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">GLOBAL_PLM:</span>
<span class="plain-syntax">                </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2" class="named-paragraph-link"><span class="named-paragraph">Assimilate definition</span><span class="named-paragraph-number">4.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP4_1" class="paragraph-anchor"></a><b>&#167;4.1. How OrigSource definitions are assimilated.</b>Note that the #OrigSource directive (with hash sign) is also valid
within a function body. We will handle that case later; see <a href="../building-module/2-eis.html" class="internal">Emitting Inter Schemas (in building)</a>.
</p>

<p class="commentary">This is not yet useful. It converts a top-level #Origsource directive
to a top-level <span class="extract"><span class="extract-syntax">PROVENANCE_IST</span></span> node, but it doesn't put it anywhere
meaningful; the node just winds up tacked onto the end of the kit.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Assimilate origsource directive</span><span class="named-paragraph-number">4.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">I6Errors::set_current_location_near_splat</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">match_results</span><span class="plain-syntax"> </span><span class="identifier-syntax">mr</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Regexp::create_mr</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">origfilestr</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">origline</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">proceed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_1_1" class="named-paragraph-link"><span class="named-paragraph">Parse text of splat for optional string and number</span><span class="named-paragraph-number">4.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">proceed</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_bookmark</span><span class="plain-syntax"> </span><span class="identifier-syntax">content_at</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterBookmark::after_this_node</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_bookmark</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IBM</span><span class="plain-syntax"> = &amp;</span><span class="identifier-syntax">content_at</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">B</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">InterBookmark::baseline</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">) + </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">text_provenance</span><span class="plain-syntax"> </span><span class="identifier-syntax">prov</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Provenance::at_file_and_line</span><span class="plain-syntax">(</span><span class="identifier-syntax">origfilestr</span><span class="plain-syntax">, </span><span class="identifier-syntax">origline</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Produce::guard</span><span class="plain-syntax">(</span><span class="identifier-syntax">ProvenanceInstruction::new_from_provenance</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">prov</span><span class="plain-syntax">, </span><span class="identifier-syntax">B</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">NodePlacement::remove</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::dispose_of</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4">&#167;4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2" class="paragraph-anchor"></a><b>&#167;4.2. How definitions are assimilated.</b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Assimilate definition</span><span class="named-paragraph-number">4.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">I6Errors::set_current_location_near_splat</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">match_results</span><span class="plain-syntax"> </span><span class="identifier-syntax">mr</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Regexp::create_mr</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">raw_identifier</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, *</span><span class="identifier-syntax">value</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">proceed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_1" class="named-paragraph-link"><span class="named-paragraph">Parse text of splat for identifier and value</span><span class="named-paragraph-number">4.2.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">proceed</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_2" class="named-paragraph-link"><span class="named-paragraph">Insert sharps in front of fake action identifiers</span><span class="named-paragraph-number">4.2.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">identifier</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">NS</span><span class="plain-syntax"> = </span><span class="identifier-syntax">SplatInstruction::namespace</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">NS</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">identifier</span><span class="plain-syntax">, </span><span class="string-syntax">"%S`"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NS</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">identifier</span><span class="plain-syntax">, </span><span class="string-syntax">"%S"</span><span class="plain-syntax">, </span><span class="identifier-syntax">raw_identifier</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3" class="named-paragraph-link"><span class="named-paragraph">Perhaps compile something from this splat</span><span class="named-paragraph-number">4.2.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">NodePlacement::remove</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">identifier</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::dispose_of</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4">&#167;4</a> (three times).</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_1" class="paragraph-anchor"></a><b>&#167;4.2.1. </b>This code is used for a range of different Inform 6 syntaxes which create
something with a given identifier name, and sometimes supply a value. For example,
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">Italian_Meringue_Temperature</span><span class="plain-syntax"> = </span><span class="constant-syntax">121</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Fake_Action</span><span class="plain-syntax"> </span><span class="identifier-syntax">Bake</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Attribute</span><span class="plain-syntax"> </span><span class="identifier-syntax">split</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Object</span><span class="plain-syntax"> </span><span class="identifier-syntax">Compass</span><span class="plain-syntax"> </span><span class="string-syntax">"compass"</span><span class="plain-syntax">;</span>
</pre>
<p class="commentary">The following finds the identifier as the second token, i.e., after the directive
keyword <span class="extract"><span class="extract-syntax">Constant</span></span> or similar. Note that an <span class="extract"><span class="extract-syntax">Object</span></span> declaration does not
meaningfully have a value, even though a third token is present.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Parse text of splat for identifier and value</span><span class="named-paragraph-number">4.2.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">S</span><span class="plain-syntax"> = </span><span class="identifier-syntax">SplatInstruction::splatter</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">directive</span><span class="plain-syntax"> == </span><span class="identifier-syntax">VERB_PLM</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">" *%C+ (%c*?) *; *"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">raw_identifier</span><span class="plain-syntax"> = </span><span class="identifier-syntax">I</span><span class="string-syntax">"assim_gv"</span><span class="plain-syntax">; </span><span class="identifier-syntax">value</span><span class="plain-syntax"> = </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0];</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">LOG</span><span class="plain-syntax">(</span><span class="string-syntax">"Unable to parse start of VERB_PLM: '%S'\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">); </span><span class="identifier-syntax">proceed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">" *%C+ *(%C+?)(--&gt; *%c*?) *; *"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">raw_identifier</span><span class="plain-syntax"> = </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0]; </span><span class="identifier-syntax">value</span><span class="plain-syntax"> = </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[1];</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">" *%C+ *(%C+?)(-&gt; *%c*?) *; *"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">raw_identifier</span><span class="plain-syntax"> = </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0]; </span><span class="identifier-syntax">value</span><span class="plain-syntax"> = </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[1];</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">" *%C+ (%C*?) *; *"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">raw_identifier</span><span class="plain-syntax"> = </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0];</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">" *%C+ (%C*) *= *(%c*?) *; *"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">raw_identifier</span><span class="plain-syntax"> = </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0]; </span><span class="identifier-syntax">value</span><span class="plain-syntax"> = </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[1];</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">" *%C+ (%C*) (%c*?) *; *"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">raw_identifier</span><span class="plain-syntax"> = </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0]; </span><span class="identifier-syntax">value</span><span class="plain-syntax"> = </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[1];</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">LOG</span><span class="plain-syntax">(</span><span class="string-syntax">"Unable to parse start of constant: '%S'\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">); </span><span class="identifier-syntax">proceed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">directive</span><span class="plain-syntax"> == </span><span class="identifier-syntax">OBJECT_PLM</span><span class="plain-syntax">) </span><span class="identifier-syntax">value</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Str::trim_all_white_space_at_end</span><span class="plain-syntax">(</span><span class="identifier-syntax">raw_identifier</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2">&#167;4.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_1_1" class="paragraph-anchor"></a><b>&#167;4.1.1. </b>The following finds <span class="extract"><span class="extract-syntax">"STRING" NUMBER</span></span>, or <span class="extract"><span class="extract-syntax">"STRING"</span></span>, or nothing.
(In its pocketses.) This is needed for the <span class="extract"><span class="extract-syntax">OrigSource</span></span> directive.
In I6 that directive can accept a second number, but we won't
worry about that here.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Parse text of splat for optional string and number</span><span class="named-paragraph-number">4.1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">S</span><span class="plain-syntax"> = </span><span class="identifier-syntax">SplatInstruction::splatter</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">" *%C+ \"(%C*)\" (%d+) *; *"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">origfilestr</span><span class="plain-syntax"> = </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0];</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">origline</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::atoi</span><span class="plain-syntax">(</span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[1], </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">" *%C+ \"(%C*)\" *; *"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">origfilestr</span><span class="plain-syntax"> = </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0];</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">" *%C+ *; *"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="comment-syntax"> bare "Origsource;" is okay</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">I6Errors::issue</span><span class="plain-syntax">(</span><span class="string-syntax">"Unable to parse ORIGSOURCE_PLM: '%S'"</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">proceed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_1">&#167;4.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_2" class="paragraph-anchor"></a><b>&#167;4.2.2. </b>An eccentricity of Inform 6 syntax is that fake action names ought to be given
in the form <span class="extract"><span class="extract-syntax">Fake_Action ##Bake</span></span>, but are not. The constant created by <span class="extract"><span class="extract-syntax">Fake_Action Bake</span></span>
is nevertheless <span class="extract"><span class="extract-syntax">##Bake</span></span>, so we take care of that here.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Insert sharps in front of fake action identifiers</span><span class="named-paragraph-number">4.2.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">directive</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FAKEACTION_PLM</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">old</span><span class="plain-syntax"> = </span><span class="identifier-syntax">raw_identifier</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">raw_identifier</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::new</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">raw_identifier</span><span class="plain-syntax">, </span><span class="string-syntax">"##%S"</span><span class="plain-syntax">, </span><span class="identifier-syntax">old</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2">&#167;4.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3" class="paragraph-anchor"></a><b>&#167;4.2.3. </b>The Inform 6 directive
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">Default</span><span class="plain-syntax"> </span><span class="identifier-syntax">Vanilla_Pod</span><span class="plain-syntax"> </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
</pre>
<p class="commentary">is essentially equivalent to
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    #</span><span class="identifier-syntax">Ifndef</span><span class="plain-syntax"> </span><span class="identifier-syntax">Vanilla_Pod</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">Vanilla_Pod</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    #</span><span class="identifier-syntax">Endif</span><span class="plain-syntax">;</span>
</pre>
<p class="commentary">So this is a piece of conditional compilation in disguise, and should perhaps
have been removed from the tree by the <span class="extract"><span class="extract-syntax">resolve-conditional-compilation</span></span> stage.
But in fact it's easier to handle it here.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Perhaps compile something from this splat</span><span class="named-paragraph-number">4.2.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">directive</span><span class="plain-syntax"> == </span><span class="identifier-syntax">DEFAULT_PLM</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Wiring::find_socket</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">identifier</span><span class="plain-syntax">) == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">directive</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CONSTANT_PLM</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1" class="named-paragraph-link"><span class="named-paragraph">Definitely compile something from this splat</span><span class="named-paragraph-number">4.2.3.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1" class="named-paragraph-link"><span class="named-paragraph">Definitely compile something from this splat</span><span class="named-paragraph-number">4.2.3.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2">&#167;4.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3_1" class="paragraph-anchor"></a><b>&#167;4.2.3.1. </b>So if we're here, we have reduced the possibilities to:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">ARRAY_PLM</span><span class="plain-syntax">         </span><span class="identifier-syntax">ATTRIBUTE_PLM</span><span class="plain-syntax">     </span><span class="identifier-syntax">CONSTANT_PLM</span><span class="plain-syntax">      </span><span class="identifier-syntax">FAKEACTION_PLM</span>
<span class="identifier-syntax">GLOBAL_PLM</span><span class="plain-syntax">        </span><span class="identifier-syntax">OBJECT_PLM</span><span class="plain-syntax">        </span><span class="identifier-syntax">PROPERTY_PLM</span><span class="plain-syntax">      </span><span class="identifier-syntax">VERB_PLM</span>
</pre>
<p class="commentary">We basically do the same thing in all of these cases: decide where to put
the result, declare a symbol for it, and then define that symbol.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Definitely compile something from this splat</span><span class="named-paragraph-number">4.2.3.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_bookmark</span><span class="plain-syntax"> </span><span class="identifier-syntax">content_at</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_1" class="named-paragraph-link"><span class="named-paragraph">Work out where in the Inter tree to put the material we are making</span><span class="named-paragraph-number">4.2.3.1.1</span></a></span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">made_s</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_2" class="named-paragraph-link"><span class="named-paragraph">Declare the Inter symbol for what we will shortly make</span><span class="named-paragraph-number">4.2.3.1.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><a href="3-css.html#SP5" class="function-link"><span class="function-syntax">CompileSplatsStage::apply_annotations</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">SplatInstruction::I6_annotation</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SplatInstruction::namespace</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">), </span><span class="identifier-syntax">made_s</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">directive</span><span class="plain-syntax"> == </span><span class="identifier-syntax">ATTRIBUTE_PLM</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">directive</span><span class="plain-syntax"> == </span><span class="identifier-syntax">PROPERTY_PLM</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_3" class="named-paragraph-link"><span class="named-paragraph">Declare a property ID symbol to go with it</span><span class="named-paragraph-number">4.2.3.1.3</span></a></span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4" class="named-paragraph-link"><span class="named-paragraph">Make a definition for made_s</span><span class="named-paragraph-number">4.2.3.1.4</span></a></span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2_3">&#167;4.2.3</a> (twice).</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3_1_1" class="paragraph-anchor"></a><b>&#167;4.2.3.1.1. </b>So, for example, <span class="extract"><span class="extract-syntax">Constant Vanilla_Pod = 1;</span></span> might result in the symbol
<span class="extract"><span class="extract-syntax">Vanilla_Pod</span></span> being created and defined with a <span class="extract"><span class="extract-syntax">CONSTANT_IST</span></span> Inter node,
all inside the package <span class="extract"><span class="extract-syntax">/main/HypotheticalKit/constants/Vanilla_Pod_con</span></span>.
</p>

<p class="commentary">Which frankly looks over-engineered for a simple constant, but some of these
definitions are not so simple.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Work out where in the Inter tree to put the material we are making</span><span class="named-paragraph-number">4.2.3.1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">submodule_name</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">suffix</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">subpackage_type</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_1_1" class="named-paragraph-link"><span class="named-paragraph">Work out what submodule to put this new material into</span><span class="named-paragraph-number">4.2.3.1.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">submodule_name</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">content_at</span><span class="plain-syntax"> = </span><a href="3-css.html#SP7" class="function-link"><span class="function-syntax">CompileSplatsStage::make_submodule</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">submodule_name</span><span class="plain-syntax">, </span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_1_2" class="named-paragraph-link"><span class="named-paragraph">Create a little package within that submodule to hold the content</span><span class="named-paragraph-number">4.2.3.1.1.2</span></a></span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">content_at</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterBookmark::after_this_node</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2_3_1">&#167;4.2.3.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3_1_1_1" class="paragraph-anchor"></a><b>&#167;4.2.3.1.1.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Work out what submodule to put this new material into</span><span class="named-paragraph-number">4.2.3.1.1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">directive</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">VERB_PLM:</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">subpackage_type</span><span class="plain-syntax"> = </span><a href="2-rp.html#SP5" class="function-link"><span class="function-syntax">RunningPipelines::get_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="constant-syntax">command_ptype_RPSYM</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">submodule_name</span><span class="plain-syntax"> = </span><span class="identifier-syntax">I</span><span class="string-syntax">"commands"</span><span class="plain-syntax">; </span><span class="identifier-syntax">suffix</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">ARRAY_PLM:</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">submodule_name</span><span class="plain-syntax"> = </span><span class="identifier-syntax">I</span><span class="string-syntax">"arrays"</span><span class="plain-syntax">; </span><span class="identifier-syntax">suffix</span><span class="plain-syntax"> = </span><span class="identifier-syntax">I</span><span class="string-syntax">"arr"</span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">CONSTANT_PLM:</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">FAKEACTION_PLM:</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">OBJECT_PLM:</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">submodule_name</span><span class="plain-syntax"> = </span><span class="identifier-syntax">I</span><span class="string-syntax">"constants"</span><span class="plain-syntax">; </span><span class="identifier-syntax">suffix</span><span class="plain-syntax"> = </span><span class="identifier-syntax">I</span><span class="string-syntax">"con"</span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">GLOBAL_PLM:</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">submodule_name</span><span class="plain-syntax"> = </span><span class="identifier-syntax">I</span><span class="string-syntax">"variables"</span><span class="plain-syntax">; </span><span class="identifier-syntax">suffix</span><span class="plain-syntax"> = </span><span class="identifier-syntax">I</span><span class="string-syntax">"var"</span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">ATTRIBUTE_PLM:</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">PROPERTY_PLM:</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">subpackage_type</span><span class="plain-syntax"> = </span><a href="2-rp.html#SP5" class="function-link"><span class="function-syntax">RunningPipelines::get_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="constant-syntax">property_ptype_RPSYM</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">submodule_name</span><span class="plain-syntax"> = </span><span class="identifier-syntax">I</span><span class="string-syntax">"properties"</span><span class="plain-syntax">; </span><span class="identifier-syntax">suffix</span><span class="plain-syntax"> = </span><span class="identifier-syntax">I</span><span class="string-syntax">"prop"</span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">submodule_name</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">subpackage_type</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">subpackage_type</span><span class="plain-syntax"> = </span><a href="2-rp.html#SP5" class="function-link"><span class="function-syntax">RunningPipelines::get_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="constant-syntax">plain_ptype_RPSYM</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2_3_1_1">&#167;4.2.3.1.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3_1_1_2" class="paragraph-anchor"></a><b>&#167;4.2.3.1.1.2. </b>The practical effect of this is to create all the packages needed which are
not already there.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Create a little package within that submodule to hold the content</span><span class="named-paragraph-number">4.2.3.1.1.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">subpackage_name</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">suffix</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">subpackage_name</span><span class="plain-syntax">, </span><span class="string-syntax">"%S_%S"</span><span class="plain-syntax">, </span><span class="identifier-syntax">identifier</span><span class="plain-syntax">, </span><span class="identifier-syntax">suffix</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">subpackage_name</span><span class="plain-syntax">, </span><span class="string-syntax">"assimilated_directive_%d"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            ++</span><span class="identifier-syntax">css</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">no_assimilated_directives</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">subpackage</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Produce::make_subpackage</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">content_at</span><span class="plain-syntax">, </span><span class="identifier-syntax">subpackage_name</span><span class="plain-syntax">, </span><span class="identifier-syntax">subpackage_type</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">InterBookmark::move_into_package</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">content_at</span><span class="plain-syntax">, </span><span class="identifier-syntax">subpackage</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">subpackage_name</span><span class="plain-syntax">)</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2_3_1_1">&#167;4.2.3.1.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3_1_2" class="paragraph-anchor"></a><b>&#167;4.2.3.1.2. </b>Now we declare <span class="extract"><span class="extract-syntax">made_s</span></span> as a symbol inside this package.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Declare the Inter symbol for what we will shortly make</span><span class="named-paragraph-number">4.2.3.1.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">made_s</span><span class="plain-syntax"> = </span><a href="3-css.html#SP6" class="function-link"><span class="function-syntax">CompileSplatsStage::make_socketed_symbol</span></a><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">content_at</span><span class="plain-syntax">, </span><span class="identifier-syntax">identifier</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Wiring::is_wired</span><span class="plain-syntax">(</span><span class="identifier-syntax">made_s</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">external_name</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Wiring::wired_to</span><span class="plain-syntax">(</span><span class="identifier-syntax">made_s</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Wiring::wire_to</span><span class="plain-syntax">(</span><span class="identifier-syntax">external_name</span><span class="plain-syntax">, </span><span class="identifier-syntax">made_s</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Wiring::wire_to</span><span class="plain-syntax">(</span><span class="identifier-syntax">made_s</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">SymbolAnnotation::set_b</span><span class="plain-syntax">(</span><span class="identifier-syntax">made_s</span><span class="plain-syntax">, </span><span class="identifier-syntax">ASSIMILATED_IANN</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">directive</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FAKEACTION_PLM</span><span class="plain-syntax">) </span><span class="identifier-syntax">SymbolAnnotation::set_b</span><span class="plain-syntax">(</span><span class="identifier-syntax">made_s</span><span class="plain-syntax">, </span><span class="identifier-syntax">FAKE_ACTION_IANN</span><span class="plain-syntax">, </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">directive</span><span class="plain-syntax"> == </span><span class="identifier-syntax">OBJECT_PLM</span><span class="plain-syntax">) </span><span class="identifier-syntax">SymbolAnnotation::set_b</span><span class="plain-syntax">(</span><span class="identifier-syntax">made_s</span><span class="plain-syntax">, </span><span class="identifier-syntax">OBJECT_IANN</span><span class="plain-syntax">, </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">directive</span><span class="plain-syntax"> == </span><span class="identifier-syntax">VERB_PLM</span><span class="plain-syntax">) </span><span class="identifier-syntax">InterSymbol::set_flag</span><span class="plain-syntax">(</span><span class="identifier-syntax">made_s</span><span class="plain-syntax">, </span><span class="identifier-syntax">MAKE_NAME_UNIQUE_ISYMF</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2_3_1">&#167;4.2.3.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3_1_3" class="paragraph-anchor"></a><b>&#167;4.2.3.1.3. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Declare a property ID symbol to go with it</span><span class="named-paragraph-number">4.2.3.1.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_bookmark</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IBM</span><span class="plain-syntax"> = &amp;</span><span class="identifier-syntax">content_at</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">id_s</span><span class="plain-syntax"> = </span><a href="3-css.html#SP6" class="function-link"><span class="function-syntax">CompileSplatsStage::make_socketed_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"property_id"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">InterSymbol::set_flag</span><span class="plain-syntax">(</span><span class="identifier-syntax">id_s</span><span class="plain-syntax">, </span><span class="identifier-syntax">MAKE_NAME_UNIQUE_ISYMF</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Produce::guard</span><span class="plain-syntax">(</span><span class="identifier-syntax">ConstantInstruction::new</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">id_s</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">InterTypes::unchecked</span><span class="plain-syntax">(), </span><span class="identifier-syntax">InterValuePairs::number</span><span class="plain-syntax">(0),</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">InterBookmark::baseline</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">) + </span><span class="constant-syntax">1</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">));</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2_3_1">&#167;4.2.3.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3_1_4" class="paragraph-anchor"></a><b>&#167;4.2.3.1.4. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Make a definition for made_s</span><span class="named-paragraph-number">4.2.3.1.4</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_bookmark</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IBM</span><span class="plain-syntax"> = &amp;</span><span class="identifier-syntax">content_at</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">directive</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">CONSTANT_PLM:</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">FAKEACTION_PLM:</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">OBJECT_PLM:</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_1" class="named-paragraph-link"><span class="named-paragraph">Make a scalar constant in Inter</span><span class="named-paragraph-number">4.2.3.1.4.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">GLOBAL_PLM:</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_2" class="named-paragraph-link"><span class="named-paragraph">Make a global variable in Inter</span><span class="named-paragraph-number">4.2.3.1.4.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">PROPERTY_PLM:</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_3" class="named-paragraph-link"><span class="named-paragraph">Make a general property in Inter</span><span class="named-paragraph-number">4.2.3.1.4.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">ATTRIBUTE_PLM:</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_4" class="named-paragraph-link"><span class="named-paragraph">Make an either-or property in Inter</span><span class="named-paragraph-number">4.2.3.1.4.4</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">VERB_PLM:</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">ARRAY_PLM:</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_5" class="named-paragraph-link"><span class="named-paragraph">Make a list constant in Inter</span><span class="named-paragraph-number">4.2.3.1.4.5</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2_3_1">&#167;4.2.3.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3_1_4_1" class="paragraph-anchor"></a><b>&#167;4.2.3.1.4.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Make a scalar constant in Inter</span><span class="named-paragraph-number">4.2.3.1.4.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">B</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">InterBookmark::baseline</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">) + </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_pair</span><span class="plain-syntax"> </span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterValuePairs::undef</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_1_1" class="named-paragraph-link"><span class="named-paragraph">Assimilate a value</span><span class="named-paragraph-number">4.2.3.1.4.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Produce::guard</span><span class="plain-syntax">(</span><span class="identifier-syntax">ConstantInstruction::new</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">made_s</span><span class="plain-syntax">, </span><span class="identifier-syntax">InterTypes::unchecked</span><span class="plain-syntax">(),</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">val</span><span class="plain-syntax">, </span><span class="identifier-syntax">B</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">));</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2_3_1_4">&#167;4.2.3.1.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3_1_4_2" class="paragraph-anchor"></a><b>&#167;4.2.3.1.4.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Make a global variable in Inter</span><span class="named-paragraph-number">4.2.3.1.4.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">B</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">InterBookmark::baseline</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">) + </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_pair</span><span class="plain-syntax"> </span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterValuePairs::undef</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_1_1" class="named-paragraph-link"><span class="named-paragraph">Assimilate a value</span><span class="named-paragraph-number">4.2.3.1.4.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Produce::guard</span><span class="plain-syntax">(</span><span class="identifier-syntax">VariableInstruction::new</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">made_s</span><span class="plain-syntax">, </span><span class="identifier-syntax">InterTypes::unchecked</span><span class="plain-syntax">(),</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">val</span><span class="plain-syntax">, </span><span class="identifier-syntax">B</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">));</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2_3_1_4">&#167;4.2.3.1.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3_1_4_3" class="paragraph-anchor"></a><b>&#167;4.2.3.1.4.3. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Make a general property in Inter</span><span class="named-paragraph-number">4.2.3.1.4.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">B</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">InterBookmark::baseline</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">) + </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Produce::guard</span><span class="plain-syntax">(</span><span class="identifier-syntax">PropertyInstruction::new</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">made_s</span><span class="plain-syntax">, </span><span class="identifier-syntax">InterTypes::unchecked</span><span class="plain-syntax">(),</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">B</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">));</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2_3_1_4">&#167;4.2.3.1.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3_1_4_4" class="paragraph-anchor"></a><b>&#167;4.2.3.1.4.4. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Make an either-or property in Inter</span><span class="named-paragraph-number">4.2.3.1.4.4</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">B</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">InterBookmark::baseline</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">) + </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Produce::guard</span><span class="plain-syntax">(</span><span class="identifier-syntax">PropertyInstruction::new</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">made_s</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">InterTypes::from_constructor_code</span><span class="plain-syntax">(</span><span class="identifier-syntax">INT2_ITCONC</span><span class="plain-syntax">), </span><span class="identifier-syntax">B</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">));</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2_3_1_4">&#167;4.2.3.1.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3_1_4_5" class="paragraph-anchor"></a><b>&#167;4.2.3.1.4.5. </b>A typical Inform 6 array declaration looks like this:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">Array</span><span class="plain-syntax"> </span><span class="identifier-syntax">Example</span><span class="plain-syntax"> </span><span class="identifier-syntax">table</span><span class="plain-syntax"> </span><span class="constant-syntax">2</span><span class="plain-syntax"> (-56) </span><span class="constant-syntax">17</span><span class="plain-syntax"> </span><span class="string-syntax">"hey, I am typeless"</span><span class="plain-syntax"> </span><span class="character-syntax">' '</span><span class="plain-syntax">;</span>
</pre>
<pre class="definitions code-font"><span class="definition-keyword">define</span> <span class="constant-syntax">MAX_ASSIMILATED_ARRAY_ENTRIES</span><span class="plain-syntax"> </span><span class="constant-syntax">10000</span>
</pre>
<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Make a list constant in Inter</span><span class="named-paragraph-number">4.2.3.1.4.5</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">match_results</span><span class="plain-syntax"> </span><span class="identifier-syntax">mr</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Regexp::create_mr</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">conts</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">as_bytes</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">bounded</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">grammatical</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">annot</span><span class="plain-syntax"> = </span><span class="identifier-syntax">INVALID_IANN</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_5_1" class="named-paragraph-link"><span class="named-paragraph">Work out the format of the array and the string of contents</span><span class="named-paragraph-number">4.2.3.1.4.5.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">annot</span><span class="plain-syntax"> != </span><span class="identifier-syntax">INVALID_IANN</span><span class="plain-syntax">) </span><span class="identifier-syntax">SymbolAnnotation::set_b</span><span class="plain-syntax">(</span><span class="identifier-syntax">made_s</span><span class="plain-syntax">, </span><span class="identifier-syntax">annot</span><span class="plain-syntax">, </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">inter_pair</span><span class="plain-syntax"> </span><span class="identifier-syntax">val_pile</span><span class="plain-syntax">[</span><span class="constant-syntax">MAX_ASSIMILATED_ARRAY_ENTRIES</span><span class="plain-syntax">];</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">no_assimilated_array_entries</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">directive</span><span class="plain-syntax"> == </span><span class="identifier-syntax">ARRAY_PLM</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_5_2" class="named-paragraph-link"><span class="named-paragraph">Compile the string of array contents into the pile of values</span><span class="named-paragraph-number">4.2.3.1.4.5.2</span></a></span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_5_3" class="named-paragraph-link"><span class="named-paragraph">Compile the string of command grammar contents into the pile of values</span><span class="named-paragraph-number">4.2.3.1.4.5.3</span></a></span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">B</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">InterBookmark::baseline</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">) + </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">format</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">grammatical</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">format</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CONST_LIST_FORMAT_GRAMMAR</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">no_assimilated_array_entries</span><span class="plain-syntax"> == </span><span class="constant-syntax">1</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">directive</span><span class="plain-syntax"> == </span><span class="identifier-syntax">ARRAY_PLM</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">as_bytes</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">bounded</span><span class="plain-syntax">) </span><span class="identifier-syntax">format</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CONST_LIST_FORMAT_B_BYTES_BY_EXTENT</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">format</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CONST_LIST_FORMAT_BYTES_BY_EXTENT</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">bounded</span><span class="plain-syntax">) </span><span class="identifier-syntax">format</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CONST_LIST_FORMAT_B_WORDS_BY_EXTENT</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">format</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CONST_LIST_FORMAT_WORDS_BY_EXTENT</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">as_bytes</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">bounded</span><span class="plain-syntax">) </span><span class="identifier-syntax">format</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CONST_LIST_FORMAT_B_BYTES</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">format</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CONST_LIST_FORMAT_BYTES</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">bounded</span><span class="plain-syntax">) </span><span class="identifier-syntax">format</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CONST_LIST_FORMAT_B_WORDS</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">format</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CONST_LIST_FORMAT_WORDS</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Produce::guard</span><span class="plain-syntax">(</span><span class="identifier-syntax">ConstantInstruction::new_list</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">made_s</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">InterTypes::from_constructor_code</span><span class="plain-syntax">(</span><span class="identifier-syntax">LIST_ITCONC</span><span class="plain-syntax">), </span><span class="identifier-syntax">format</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">no_assimilated_array_entries</span><span class="plain-syntax">, </span><span class="identifier-syntax">val_pile</span><span class="plain-syntax">, </span><span class="identifier-syntax">B</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::dispose_of</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2_3_1_4">&#167;4.2.3.1.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3_1_4_5_1" class="paragraph-anchor"></a><b>&#167;4.2.3.1.4.5.1. </b>At this point <span class="extract"><span class="extract-syntax">value</span></span> is <span class="extract"><span class="extract-syntax">table 2 (-56) 17 "hey, I am typeless" ' '</span></span>. We want
first to work out which of the several array formats this is, then the contents
<span class="extract"><span class="extract-syntax">2 (-56) 17 "hey, I am typeless" ' '</span></span>.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Work out the format of the array and the string of contents</span><span class="named-paragraph-number">4.2.3.1.4.5.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">directive</span><span class="plain-syntax"> == </span><span class="identifier-syntax">ARRAY_PLM</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">value</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">" *--&gt; *(%c*?) *"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">conts</span><span class="plain-syntax"> = </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0];</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">value</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">" *-&gt; *(%c*?) *"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">conts</span><span class="plain-syntax"> = </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0]; </span><span class="identifier-syntax">as_bytes</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">value</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">" *table *(%c*?) *"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">conts</span><span class="plain-syntax"> = </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0]; </span><span class="identifier-syntax">bounded</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">value</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">" *buffer *(%c*?) *"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">conts</span><span class="plain-syntax"> = </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0]; </span><span class="identifier-syntax">as_bytes</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">; </span><span class="identifier-syntax">bounded</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">value</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">" *string *(%c*?) *"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">I6Errors::issue</span><span class="plain-syntax">(</span>
<span class="plain-syntax">                </span><span class="string-syntax">"cannot make array '%S': the 'string' initialiser is unsupported"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">identifier</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">I6Errors::issue</span><span class="plain-syntax">(</span>
<span class="plain-syntax">                </span><span class="string-syntax">"cannot make array '%S': the initial value syntax is unrecognised"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">identifier</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">conts</span><span class="plain-syntax"> = </span><span class="identifier-syntax">value</span><span class="plain-syntax">; </span><span class="identifier-syntax">grammatical</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2_3_1_4_5">&#167;4.2.3.1.4.5</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3_1_4_5_2" class="paragraph-anchor"></a><b>&#167;4.2.3.1.4.5.2. </b>The contents text is now tokenised, and each token produces an array entry.
</p>

<p class="commentary">Although it is legal in Inform 6 to write arrays like, say.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">Array</span><span class="plain-syntax"> </span><span class="identifier-syntax">Example</span><span class="plain-syntax"> --&gt; </span><span class="character-syntax">'a'</span><span class="plain-syntax"> + </span><span class="constant-syntax">2</span><span class="plain-syntax"> (24);</span>
</pre>
<p class="commentary">where the entries are specified in a way using arithmetic operators, we won't
support that here: the standard Inform kits do not need it, and it's hard to
see why other kits would, either.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Compile the string of array contents into the pile of values</span><span class="named-paragraph-number">4.2.3.1.4.5.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">match_results</span><span class="plain-syntax"> </span><span class="identifier-syntax">mr</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Regexp::create_mr</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">conts</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">" *%[ *(%c*?) *%] *"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_5_2_1" class="named-paragraph-link"><span class="named-paragraph">Parse the new-style I6 array entry notation</span><span class="named-paragraph-number">4.2.3.1.4.5.2.1</span></a></span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_5_2_2" class="named-paragraph-link"><span class="named-paragraph">Parse the old-style I6 array entry notation</span><span class="named-paragraph-number">4.2.3.1.4.5.2.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Regexp::dispose_of</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2_3_1_4_5">&#167;4.2.3.1.4.5</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3_1_4_5_2_1" class="paragraph-anchor"></a><b>&#167;4.2.3.1.4.5.2.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Parse the new-style I6 array entry notation</span><span class="named-paragraph-number">4.2.3.1.4.5.2.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">entries</span><span class="plain-syntax"> = </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0];</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">sq</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">dq</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">from</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">i</span><span class="plain-syntax">&lt;</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">entries</span><span class="plain-syntax">); </span><span class="identifier-syntax">i</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inchar32_t</span><span class="plain-syntax"> </span><span class="identifier-syntax">c</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">entries</span><span class="plain-syntax">, </span><span class="identifier-syntax">i</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">c</span><span class="plain-syntax"> == </span><span class="character-syntax">';'</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">sq</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">dq</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">to</span><span class="plain-syntax"> = </span><span class="identifier-syntax">i</span><span class="plain-syntax">-1;</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_5_2_1_1" class="named-paragraph-link"><span class="named-paragraph">Eat off a chunk</span><span class="named-paragraph-number">4.2.3.1.4.5.2.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">from</span><span class="plain-syntax"> = </span><span class="identifier-syntax">i</span><span class="plain-syntax">+1;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">c</span><span class="plain-syntax"> == </span><span class="character-syntax">'\''</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">dq</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">sq</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) </span><span class="identifier-syntax">sq</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">sq</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">entries</span><span class="plain-syntax">, </span><span class="identifier-syntax">i</span><span class="plain-syntax">-1) != </span><span class="character-syntax">'\\'</span><span class="plain-syntax">)) </span><span class="identifier-syntax">sq</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">c</span><span class="plain-syntax"> == </span><span class="character-syntax">'\"'</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">sq</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">dq</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) </span><span class="identifier-syntax">dq</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">dq</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">entries</span><span class="plain-syntax">) &gt; </span><span class="identifier-syntax">from</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">to</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">entries</span><span class="plain-syntax">) - </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_5_2_1_1" class="named-paragraph-link"><span class="named-paragraph">Eat off a chunk</span><span class="named-paragraph-number">4.2.3.1.4.5.2.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2_3_1_4_5_2">&#167;4.2.3.1.4.5.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3_1_4_5_2_1_1" class="paragraph-anchor"></a><b>&#167;4.2.3.1.4.5.2.1.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Eat off a chunk</span><span class="named-paragraph-number">4.2.3.1.4.5.2.1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">full_conts</span><span class="plain-syntax"> = </span><span class="identifier-syntax">entries</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">count_before</span><span class="plain-syntax"> = </span><span class="identifier-syntax">no_assimilated_array_entries</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">conts</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">j</span><span class="plain-syntax">=</span><span class="identifier-syntax">from</span><span class="plain-syntax">; </span><span class="identifier-syntax">j</span><span class="plain-syntax">&lt;=</span><span class="identifier-syntax">to</span><span class="plain-syntax">; </span><span class="identifier-syntax">j</span><span class="plain-syntax">++) </span><span class="identifier-syntax">PUT_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">conts</span><span class="plain-syntax">, </span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">full_conts</span><span class="plain-syntax">, </span><span class="identifier-syntax">j</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_5_2_2" class="named-paragraph-link"><span class="named-paragraph">Parse the old-style I6 array entry notation</span><span class="named-paragraph-number">4.2.3.1.4.5.2.2</span></a></span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">conts</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">no_assimilated_array_entries</span><span class="plain-syntax"> == </span><span class="identifier-syntax">count_before</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">I6Errors::issue</span><span class="plain-syntax">(</span><span class="string-syntax">"array '%S' contains empty entry"</span><span class="plain-syntax">, </span><span class="identifier-syntax">identifier</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">no_assimilated_array_entries</span><span class="plain-syntax"> &gt; </span><span class="identifier-syntax">count_before</span><span class="plain-syntax">+1)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">I6Errors::issue</span><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="string-syntax">"multiple entries between ';' markers in array '%S'"</span><span class="plain-syntax">, </span><span class="identifier-syntax">identifier</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2_3_1_4_5_2_1">&#167;4.2.3.1.4.5.2.1</a> (twice).</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3_1_4_5_2_2" class="paragraph-anchor"></a><b>&#167;4.2.3.1.4.5.2.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Parse the old-style I6 array entry notation</span><span class="named-paragraph-number">4.2.3.1.4.5.2.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">string_position</span><span class="plain-syntax"> </span><span class="identifier-syntax">spos</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::start</span><span class="plain-syntax">(</span><span class="identifier-syntax">conts</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">finished</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">while</span><span class="plain-syntax"> (</span><span class="identifier-syntax">finished</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">value</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_5_2_2_2" class="named-paragraph-link"><span class="named-paragraph">Extract a token</span><span class="named-paragraph-number">4.2.3.1.4.5.2.2.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">value</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_5_2_2_1" class="named-paragraph-link"><span class="named-paragraph">Process the token</span><span class="named-paragraph-number">4.2.3.1.4.5.2.2.1</span></a></span><span class="plain-syntax"> </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">finished</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">value</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2_3_1_4_5_2">&#167;4.2.3.1.4.5.2</a> and <a href="3-css.html#SP4_2_3_1_4_5_2_1_1">&#167;4.2.3.1.4.5.2.1.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3_1_4_5_2_2_1" class="paragraph-anchor"></a><b>&#167;4.2.3.1.4.5.2.2.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Process the token</span><span class="named-paragraph-number">4.2.3.1.4.5.2.2.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">value</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"+"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">I6Errors::issue</span><span class="plain-syntax">(</span><span class="string-syntax">"array '%S' gives its size using operator '+' "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"(use brackets '(' ... ')' around the size for a calculated array size)"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">identifier</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">value</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"-"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">I6Errors::issue</span><span class="plain-syntax">(</span><span class="string-syntax">"array '%S' gives its size using operator '-' "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"(use brackets '(' ... ')' around the size for a calculated array size)"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">identifier</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">value</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"*"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">I6Errors::issue</span><span class="plain-syntax">(</span><span class="string-syntax">"array '%S' gives its size using operator '*' "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"(use brackets '(' ... ')' around the size for a calculated array size)"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">identifier</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">value</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"/"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">I6Errors::issue</span><span class="plain-syntax">(</span><span class="string-syntax">"array '%S' gives its size using operator '/' "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"(use brackets '(' ... ')' around the size for a calculated array size)"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">identifier</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_pair</span><span class="plain-syntax"> </span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterValuePairs::undef</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_1_1" class="named-paragraph-link"><span class="named-paragraph">Assimilate a value</span><span class="named-paragraph-number">4.2.3.1.4.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_5_2_2_1_1" class="named-paragraph-link"><span class="named-paragraph">Add value to the entry pile</span><span class="named-paragraph-number">4.2.3.1.4.5.2.2.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2_3_1_4_5_2_2">&#167;4.2.3.1.4.5.2.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3_1_4_5_3" class="paragraph-anchor"></a><b>&#167;4.2.3.1.4.5.3. </b>In command grammar introduced by <span class="extract"><span class="extract-syntax">Verb</span></span>, the tokens <span class="extract"><span class="extract-syntax">*</span></span> and <span class="extract"><span class="extract-syntax">/</span></span> can occur
without having any arithmetic meaning, so they must not be rejected. That's
really why we treat this case as different, though we also treat keywords
occurring after <span class="extract"><span class="extract-syntax">-&gt;</span></span> markers as being action names, and introduce <span class="extract"><span class="extract-syntax">##</span></span>s to
their names. Thus in:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">Verb</span><span class="plain-syntax"> </span><span class="character-syntax">'do'</span><span class="plain-syntax"> * </span><span class="character-syntax">'something'</span><span class="plain-syntax"> -&gt; </span><span class="identifier-syntax">Do</span><span class="plain-syntax">;</span>
</pre>
<p class="commentary">the action name <span class="extract"><span class="extract-syntax">Do</span></span> is converted automatically to <span class="extract"><span class="extract-syntax">##Do</span></span>, the actual identifier
for the action.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Compile the string of command grammar contents into the pile of values</span><span class="named-paragraph-number">4.2.3.1.4.5.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">string_position</span><span class="plain-syntax"> </span><span class="identifier-syntax">spos</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::start</span><span class="plain-syntax">(</span><span class="identifier-syntax">conts</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">NT</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="identifier-syntax">next_is_action</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">finished</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">while</span><span class="plain-syntax"> (</span><span class="identifier-syntax">finished</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">value</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">next_is_action</span><span class="plain-syntax">) </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">value</span><span class="plain-syntax">, </span><span class="string-syntax">"##"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_5_2_2_2" class="named-paragraph-link"><span class="named-paragraph">Extract a token</span><span class="named-paragraph-number">4.2.3.1.4.5.2.2.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">next_is_action</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_5_3_1" class="named-paragraph-link"><span class="named-paragraph">Ensure that a socket exists for this action name</span><span class="named-paragraph-number">4.2.3.1.4.5.3.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">next_is_action</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">NT</span><span class="plain-syntax">++ == </span><span class="constant-syntax">0</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">value</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"meta"</span><span class="plain-syntax">))) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">inter_pair</span><span class="plain-syntax"> </span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterValuePairs::symbolic</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><a href="2-rp.html#SP6" class="function-link"><span class="function-syntax">RunningPipelines::ensure_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="constant-syntax">verb_directive_meta_RPSYM</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">I</span><span class="string-syntax">"VERB_DIRECTIVE_META"</span><span class="plain-syntax">));</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_5_2_2_1_1" class="named-paragraph-link"><span class="named-paragraph">Add value to the entry pile</span><span class="named-paragraph-number">4.2.3.1.4.5.2.2.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">value</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">inter_pair</span><span class="plain-syntax"> </span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterValuePairs::undef</span><span class="plain-syntax">(); </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">marker</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NOT_APPLICABLE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_5_3_2" class="named-paragraph-link"><span class="named-paragraph">Assimilate a value in grammar</span><span class="named-paragraph-number">4.2.3.1.4.5.3.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">marker</span><span class="plain-syntax"> == </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">inter_pair</span><span class="plain-syntax"> </span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterValuePairs::symbolic</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                    </span><a href="2-rp.html#SP6" class="function-link"><span class="function-syntax">RunningPipelines::ensure_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="constant-syntax">verb_directive_noun_filter_RPSYM</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                        </span><span class="identifier-syntax">I</span><span class="string-syntax">"VERB_DIRECTIVE_NOUN_FILTER"</span><span class="plain-syntax">));</span>
<span class="plain-syntax">                </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_5_2_2_1_1" class="named-paragraph-link"><span class="named-paragraph">Add value to the entry pile</span><span class="named-paragraph-number">4.2.3.1.4.5.2.2.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">            } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">marker</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">inter_pair</span><span class="plain-syntax"> </span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterValuePairs::symbolic</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                    </span><a href="2-rp.html#SP6" class="function-link"><span class="function-syntax">RunningPipelines::ensure_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="constant-syntax">verb_directive_scope_filter_RPSYM</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                        </span><span class="identifier-syntax">I</span><span class="string-syntax">"VERB_DIRECTIVE_SCOPE_FILTER"</span><span class="plain-syntax">));</span>
<span class="plain-syntax">                </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_5_2_2_1_1" class="named-paragraph-link"><span class="named-paragraph">Add value to the entry pile</span><span class="named-paragraph-number">4.2.3.1.4.5.2.2.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_5_2_2_1_1" class="named-paragraph-link"><span class="named-paragraph">Add value to the entry pile</span><span class="named-paragraph-number">4.2.3.1.4.5.2.2.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">value</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"-&gt;"</span><span class="plain-syntax">)) </span><span class="identifier-syntax">next_is_action</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">finished</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">value</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2_3_1_4_5">&#167;4.2.3.1.4.5</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3_1_4_5_3_1" class="paragraph-anchor"></a><b>&#167;4.2.3.1.4.5.3.1. </b>So here <span class="extract"><span class="extract-syntax">value</span></span> is something like <span class="extract"><span class="extract-syntax">##ScriptOn</span></span>, an action name. Maybe that has
already been defined in the kit currently being compiled, in which case a socket
for it already exists; but maybe not, in which case we have to create the
action. This will be a package at, say, <span class="extract"><span class="extract-syntax">/main/HypotheticalKit/actions/assim_action_1</span></span>
with three things in it:
</p>

<ul class="items"><li>(a) an ID, <span class="extract"><span class="extract-syntax">action_id</span></span>;
</li><li>(b) the action name, <span class="extract"><span class="extract-syntax">##ScriptOn</span></span>;
</li><li>(c) the function to carry out the action, <span class="extract"><span class="extract-syntax">ScriptOnSub</span></span>.
</li></ul>
<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Ensure that a socket exists for this action name</span><span class="named-paragraph-number">4.2.3.1.4.5.3.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Wiring::find_socket</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">value</span><span class="plain-syntax">) == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_bookmark</span><span class="plain-syntax"> </span><span class="identifier-syntax">IBM_d</span><span class="plain-syntax"> = </span><a href="3-css.html#SP7" class="function-link"><span class="function-syntax">CompileSplatsStage::make_submodule</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"actions"</span><span class="plain-syntax">, </span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_bookmark</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IBM</span><span class="plain-syntax"> = &amp;</span><span class="identifier-syntax">IBM_d</span><span class="plain-syntax">;</span>

<span class="plain-syntax">        </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">action_package</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_5_3_1_1" class="named-paragraph-link"><span class="named-paragraph">Make a package for the new action, inside the actions submodule</span><span class="named-paragraph-number">4.2.3.1.4.5.3.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">InterBookmark::move_into_package</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">action_package</span><span class="plain-syntax">);</span>

<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_5_3_1_2" class="named-paragraph-link"><span class="named-paragraph">Make an action_id symbol in the action package</span><span class="named-paragraph-number">4.2.3.1.4.5.3.1.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_5_3_1_3" class="named-paragraph-link"><span class="named-paragraph">Make the actual double-sharped action symbol</span><span class="named-paragraph-number">4.2.3.1.4.5.3.1.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_5_3_1_4" class="named-paragraph-link"><span class="named-paragraph">Make a symbol equated to the function carrying out the action</span><span class="named-paragraph-number">4.2.3.1.4.5.3.1.4</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2_3_1_4_5_3">&#167;4.2.3.1.4.5.3</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3_1_4_5_3_1_1" class="paragraph-anchor"></a><b>&#167;4.2.3.1.4.5.3.1.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Make a package for the new action, inside the actions submodule</span><span class="named-paragraph-number">4.2.3.1.4.5.3.1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ptype</span><span class="plain-syntax"> = </span><a href="2-rp.html#SP5" class="function-link"><span class="function-syntax">RunningPipelines::get_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="constant-syntax">action_ptype_RPSYM</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ptype</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">ptype</span><span class="plain-syntax"> = </span><a href="2-rp.html#SP5" class="function-link"><span class="function-syntax">RunningPipelines::get_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="constant-syntax">plain_ptype_RPSYM</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">an</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">an</span><span class="plain-syntax">, </span><span class="string-syntax">"assim_action_%d"</span><span class="plain-syntax">, ++</span><span class="identifier-syntax">css</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">no_assimilated_actions</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">action_package</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Produce::make_subpackage</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">an</span><span class="plain-syntax">, </span><span class="identifier-syntax">ptype</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">an</span><span class="plain-syntax">)</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2_3_1_4_5_3_1">&#167;4.2.3.1.4.5.3.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3_1_4_5_3_1_2" class="paragraph-anchor"></a><b>&#167;4.2.3.1.4.5.3.1.2. </b>Each action package has to contain an <span class="extract"><span class="extract-syntax">action_id</span></span> symbol, which will eventually
be defined as a unique ID for the action. But those unique IDs can only be
assigned at link time &mdash; at this stage we cannot know what other actions exist
in other compilation units. So we create <span class="extract"><span class="extract-syntax">action_id</span></span> equal just to 0 for now.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Make an action_id symbol in the action package</span><span class="named-paragraph-number">4.2.3.1.4.5.3.1.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">action_id_s</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterSymbolsTable::create_with_unique_name</span><span class="plain-syntax">(</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">InterBookmark::scope</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">), </span><span class="identifier-syntax">I</span><span class="string-syntax">"action_id"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">B</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">InterBookmark::baseline</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">) + </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Produce::guard</span><span class="plain-syntax">(</span><span class="identifier-syntax">ConstantInstruction::new</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">action_id_s</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">InterTypes::unchecked</span><span class="plain-syntax">(), </span><span class="identifier-syntax">InterValuePairs::number</span><span class="plain-syntax">(0), </span><span class="identifier-syntax">B</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">InterSymbol::set_flag</span><span class="plain-syntax">(</span><span class="identifier-syntax">action_id_s</span><span class="plain-syntax">, </span><span class="identifier-syntax">MAKE_NAME_UNIQUE_ISYMF</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">assim_s</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterSymbolsTable::create_with_unique_name</span><span class="plain-syntax">(</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">InterBookmark::scope</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">), </span><span class="identifier-syntax">I</span><span class="string-syntax">"^action_assimilated"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">B</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">InterBookmark::baseline</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">) + </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Produce::guard</span><span class="plain-syntax">(</span><span class="identifier-syntax">ConstantInstruction::new</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">assim_s</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">InterTypes::unchecked</span><span class="plain-syntax">(), </span><span class="identifier-syntax">InterValuePairs::number</span><span class="plain-syntax">(1), </span><span class="identifier-syntax">B</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">));</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2_3_1_4_5_3_1">&#167;4.2.3.1.4.5.3.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3_1_4_5_3_1_3" class="paragraph-anchor"></a><b>&#167;4.2.3.1.4.5.3.1.3. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Make the actual double-sharped action symbol</span><span class="named-paragraph-number">4.2.3.1.4.5.3.1.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">action_s</span><span class="plain-syntax"> = </span><a href="3-css.html#SP6" class="function-link"><span class="function-syntax">CompileSplatsStage::make_socketed_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">value</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">B</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">InterBookmark::baseline</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">) + </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Produce::guard</span><span class="plain-syntax">(</span><span class="identifier-syntax">ConstantInstruction::new</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">action_s</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">InterTypes::unchecked</span><span class="plain-syntax">(), </span><span class="identifier-syntax">InterValuePairs::number</span><span class="plain-syntax">(10000), </span><span class="identifier-syntax">B</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">metadata_s</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterSymbolsTable::create_with_unique_name</span><span class="plain-syntax">(</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">InterBookmark::scope</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">), </span><span class="identifier-syntax">I</span><span class="string-syntax">"^double_sharp"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Produce::guard</span><span class="plain-syntax">(</span><span class="identifier-syntax">ConstantInstruction::new</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">metadata_s</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">InterTypes::unchecked</span><span class="plain-syntax">(), </span><span class="identifier-syntax">InterValuePairs::symbolic</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">action_s</span><span class="plain-syntax">), </span><span class="identifier-syntax">B</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">));</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2_3_1_4_5_3_1">&#167;4.2.3.1.4.5.3.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3_1_4_5_3_1_4" class="paragraph-anchor"></a><b>&#167;4.2.3.1.4.5.3.1.4. </b>The Inter convention is that an action package should contain a function
to carry it out; for <span class="extract"><span class="extract-syntax">##ScriptOn</span></span>, this would be called <span class="extract"><span class="extract-syntax">ScriptOnSub</span></span>. In fact
we don't actually define it here! We assume it has already been compiled, and
that we can therefore simply create the function name <span class="extract"><span class="extract-syntax">ScriptOnSub</span></span> here,
equating it to a function definition elsewhere.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Make a symbol equated to the function carrying out the action</span><span class="named-paragraph-number">4.2.3.1.4.5.3.1.4</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">fn_name</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">fn_name</span><span class="plain-syntax">, </span><span class="string-syntax">"%SSub"</span><span class="plain-syntax">, </span><span class="identifier-syntax">value</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Str::delete_first_character</span><span class="plain-syntax">(</span><span class="identifier-syntax">fn_name</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Str::delete_first_character</span><span class="plain-syntax">(</span><span class="identifier-syntax">fn_name</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">fn_s</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">InterSymbolsTable::create_with_unique_name</span><span class="plain-syntax">(</span><span class="identifier-syntax">InterBookmark::scope</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">), </span><span class="identifier-syntax">fn_name</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">existing_fn_s</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Wiring::find_socket</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">fn_name</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">existing_fn_s</span><span class="plain-syntax">) </span><span class="identifier-syntax">Wiring::wire_to</span><span class="plain-syntax">(</span><span class="identifier-syntax">fn_s</span><span class="plain-syntax">, </span><span class="identifier-syntax">existing_fn_s</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">fn_name</span><span class="plain-syntax">)</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2_3_1_4_5_3_1">&#167;4.2.3.1.4.5.3.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3_1_4_1_1" class="paragraph-anchor"></a><b>&#167;4.2.3.1.4.1.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Assimilate a value</span><span class="named-paragraph-number">4.2.3.1.4.1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">value</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><a href="3-css.html#SP8" class="function-link"><span class="function-syntax">CompileSplatsStage::value</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">value</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            (</span><span class="identifier-syntax">directive</span><span class="plain-syntax"> == </span><span class="identifier-syntax">VERB_PLM</span><span class="plain-syntax">)?</span><span class="identifier-syntax">TRUE:FALSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterValuePairs::number</span><span class="plain-syntax">(0);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2_3_1_4_1">&#167;4.2.3.1.4.1</a>, <a href="3-css.html#SP4_2_3_1_4_2">&#167;4.2.3.1.4.2</a> and <a href="3-css.html#SP4_2_3_1_4_5_2_2_1">&#167;4.2.3.1.4.5.2.2.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3_1_4_5_3_2" class="paragraph-anchor"></a><b>&#167;4.2.3.1.4.5.3.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Assimilate a value in grammar</span><span class="named-paragraph-number">4.2.3.1.4.5.3.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">value</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><a href="3-css.html#SP8" class="function-link"><span class="function-syntax">CompileSplatsStage::value</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">value</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            (</span><span class="identifier-syntax">directive</span><span class="plain-syntax"> == </span><span class="identifier-syntax">VERB_PLM</span><span class="plain-syntax">)?</span><span class="identifier-syntax">TRUE:FALSE</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">marker</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterValuePairs::number</span><span class="plain-syntax">(0);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2_3_1_4_5_3">&#167;4.2.3.1.4.5.3</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3_1_4_5_2_2_1_1" class="paragraph-anchor"></a><b>&#167;4.2.3.1.4.5.2.2.1.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Add value to the entry pile</span><span class="named-paragraph-number">4.2.3.1.4.5.2.2.1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">no_assimilated_array_entries</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">MAX_ASSIMILATED_ARRAY_ENTRIES</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">I6Errors::issue</span><span class="plain-syntax">(</span><span class="string-syntax">"excessively long Verb or Extend"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">val_pile</span><span class="plain-syntax">[</span><span class="identifier-syntax">no_assimilated_array_entries</span><span class="plain-syntax">] = </span><span class="identifier-syntax">val</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">no_assimilated_array_entries</span><span class="plain-syntax">++;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2_3_1_4_5_2_2_1">&#167;4.2.3.1.4.5.2.2.1</a> and <a href="3-css.html#SP4_2_3_1_4_5_3">&#167;4.2.3.1.4.5.3</a> (four times).</li></ul>
<p class="commentary firstcommentary"><a id="SP4_2_3_1_4_5_2_2_2" class="paragraph-anchor"></a><b>&#167;4.2.3.1.4.5.2.2.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Extract a token</span><span class="named-paragraph-number">4.2.3.1.4.5.2.2.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">squoted</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">dquoted</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">bracketed</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">while</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Str::in_range</span><span class="plain-syntax">(</span><span class="identifier-syntax">spos</span><span class="plain-syntax">)) &amp;&amp; (</span><span class="identifier-syntax">Characters::is_whitespace</span><span class="plain-syntax">(</span><span class="identifier-syntax">Str::get</span><span class="plain-syntax">(</span><span class="identifier-syntax">spos</span><span class="plain-syntax">))))</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">spos</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::forward</span><span class="plain-syntax">(</span><span class="identifier-syntax">spos</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">while</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::in_range</span><span class="plain-syntax">(</span><span class="identifier-syntax">spos</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inchar32_t</span><span class="plain-syntax"> </span><span class="identifier-syntax">c</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::get</span><span class="plain-syntax">(</span><span class="identifier-syntax">spos</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Characters::is_whitespace</span><span class="plain-syntax">(</span><span class="identifier-syntax">c</span><span class="plain-syntax">)) &amp;&amp; (</span><span class="identifier-syntax">squoted</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">            (</span><span class="identifier-syntax">dquoted</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">bracketed</span><span class="plain-syntax"> == </span><span class="constant-syntax">0</span><span class="plain-syntax">)) </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">c</span><span class="plain-syntax"> == </span><span class="character-syntax">'\''</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">dquoted</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)) </span><span class="identifier-syntax">squoted</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">squoted</span><span class="plain-syntax">)?</span><span class="identifier-syntax">FALSE:TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">c</span><span class="plain-syntax"> == </span><span class="character-syntax">'\"'</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">squoted</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)) </span><span class="identifier-syntax">dquoted</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">dquoted</span><span class="plain-syntax">)?</span><span class="identifier-syntax">FALSE:TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">c</span><span class="plain-syntax"> == </span><span class="character-syntax">'('</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">dquoted</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">squoted</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)) </span><span class="identifier-syntax">bracketed</span><span class="plain-syntax">++;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">c</span><span class="plain-syntax"> == </span><span class="character-syntax">')'</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">dquoted</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">squoted</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)) </span><span class="identifier-syntax">bracketed</span><span class="plain-syntax">--;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">PUT_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">value</span><span class="plain-syntax">, </span><span class="identifier-syntax">c</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">spos</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::forward</span><span class="plain-syntax">(</span><span class="identifier-syntax">spos</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_2_3_1_4_5_2_2">&#167;4.2.3.1.4.5.2.2</a>, <a href="3-css.html#SP4_2_3_1_4_5_3">&#167;4.2.3.1.4.5.3</a> and <a href="3-css.html#SP4_3_3_2_1">&#167;4.3.3.2.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_3" class="paragraph-anchor"></a><b>&#167;4.3. How functions are assimilated.</b>Functions in Inform 6 are usually called "routines", and have a syntax like so:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    [ </span><span class="identifier-syntax">Example</span><span class="plain-syntax"> </span><span class="identifier-syntax">x</span><span class="plain-syntax"> </span><span class="identifier-syntax">y</span><span class="plain-syntax"> </span><span class="identifier-syntax">tmp</span><span class="plain-syntax">;</span>
<span class="plain-syntax">       </span><span class="identifier-syntax">tmp</span><span class="plain-syntax"> = </span><span class="identifier-syntax">x</span><span class="plain-syntax">*</span><span class="identifier-syntax">y</span><span class="plain-syntax">;</span>
<span class="plain-syntax">       </span><span class="reserved-syntax">print</span><span class="plain-syntax"> </span><span class="string-syntax">"Product seems to be "</span><span class="plain-syntax">, </span><span class="identifier-syntax">tmp</span><span class="plain-syntax">, </span><span class="string-syntax">".^"</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    ];</span>
</pre>
<p class="commentary">We are concerned more with the surround than with the contents of the function
in this section.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Assimilate routine</span><span class="named-paragraph-number">4.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">I6Errors::set_current_location_near_splat</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">raw_identifier</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, *</span><span class="identifier-syntax">local_var_names</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, *</span><span class="identifier-syntax">body</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">match_results</span><span class="plain-syntax"> </span><span class="identifier-syntax">mr</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Regexp::create_mr</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">line_offset</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">SplatInstruction::plm</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">) == </span><span class="identifier-syntax">ROUTINE_PLM</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_3_1" class="named-paragraph-link"><span class="named-paragraph">Parse the routine header</span><span class="named-paragraph-number">4.3.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">SplatInstruction::plm</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">) == </span><span class="identifier-syntax">STUB_PLM</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_3_2" class="named-paragraph-link"><span class="named-paragraph">Parse the stub directive</span><span class="named-paragraph-number">4.3.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">raw_identifier</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">identifier</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">NS</span><span class="plain-syntax"> = </span><span class="identifier-syntax">SplatInstruction::namespace</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">NS</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">identifier</span><span class="plain-syntax">, </span><span class="string-syntax">"%S`"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NS</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">identifier</span><span class="plain-syntax">, </span><span class="string-syntax">"%S"</span><span class="plain-syntax">, </span><span class="identifier-syntax">raw_identifier</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_3_3" class="named-paragraph-link"><span class="named-paragraph">Turn this into a function package</span><span class="named-paragraph-number">4.3.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">NodePlacement::remove</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">identifier</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4">&#167;4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_3_1" class="paragraph-anchor"></a><b>&#167;4.3.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Parse the routine header</span><span class="named-paragraph-number">4.3.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">S</span><span class="plain-syntax"> = </span><span class="identifier-syntax">SplatInstruction::splatter</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">pos</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">" *%[ *([A-Za-z0-9_`]+) *; *(%c*)"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">raw_identifier</span><span class="plain-syntax"> = </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0]; </span><span class="identifier-syntax">body</span><span class="plain-syntax"> = </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[1]; </span><span class="identifier-syntax">pos</span><span class="plain-syntax"> = </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp_at</span><span class="plain-syntax">[1];</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">" *%[ *([A-Za-z0-9_`]+) *(%c*?); *(%c*)"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">raw_identifier</span><span class="plain-syntax"> = </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0]; </span><span class="identifier-syntax">local_var_names</span><span class="plain-syntax"> = </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[1]; </span><span class="identifier-syntax">body</span><span class="plain-syntax"> = </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[2]; </span><span class="identifier-syntax">pos</span><span class="plain-syntax"> = </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp_at</span><span class="plain-syntax">[2];</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">" *%[ *(%c+?) *; *(%c*)"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">I6Errors::issue</span><span class="plain-syntax">(</span><span class="string-syntax">"invalid Inform 6 routine declaration: '%S'"</span><span class="plain-syntax">, </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0]);</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">start</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::duplicate</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Str::truncate</span><span class="plain-syntax">(</span><span class="identifier-syntax">start</span><span class="plain-syntax">, </span><span class="constant-syntax">50</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">I6Errors::issue</span><span class="plain-syntax">(</span><span class="string-syntax">"invalid Inform 6 routine declaration: '%S'"</span><span class="plain-syntax">, </span><span class="identifier-syntax">start</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">i</span><span class="plain-syntax">&lt;</span><span class="identifier-syntax">pos</span><span class="plain-syntax">; </span><span class="identifier-syntax">i</span><span class="plain-syntax">++)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">i</span><span class="plain-syntax">) == </span><span class="character-syntax">'\n'</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">line_offset</span><span class="plain-syntax">++;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_3">&#167;4.3</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_3_2" class="paragraph-anchor"></a><b>&#167;4.3.2. </b>Another of Inform 6's shabby notations for conditional compilation in disguise
is the <span class="extract"><span class="extract-syntax">Stub</span></span> directive, which looks like so:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">Stub</span><span class="plain-syntax"> </span><span class="identifier-syntax">Example</span><span class="plain-syntax"> </span><span class="constant-syntax">2</span><span class="plain-syntax">;</span>
</pre>
<p class="commentary">This means "if no <span class="extract"><span class="extract-syntax">Example</span></span> routine exists, create one now, and give it two
local variables". Such a stub routine contains no code, so it doesn't matter
what these variables are called, of course. We rewrite so that it's as if the
kit code had written:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    [ </span><span class="identifier-syntax">Example</span><span class="plain-syntax"> </span><span class="identifier-syntax">x1</span><span class="plain-syntax"> </span><span class="identifier-syntax">x2</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    ];</span>
</pre>
<p class="commentary">Note that here the compilation is unconditional. Because kits are precompiled,
there's no sensible way to provide these only if they are not elsewhere
provided. So this is no longer a useful directive, and it continues to be
supported only to avoid throwing errors.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Parse the stub directive</span><span class="named-paragraph-number">4.3.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">S</span><span class="plain-syntax"> = </span><span class="identifier-syntax">SplatInstruction::splatter</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">" *%C+ *([A-Za-z0-9_`]+) (%d+);%c*"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">raw_identifier</span><span class="plain-syntax"> = </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0];</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">local_var_names</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::new</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">N</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::atoi</span><span class="plain-syntax">(</span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[1], </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">N</span><span class="plain-syntax">&lt;0) || (</span><span class="identifier-syntax">N</span><span class="plain-syntax">&gt;15)) </span><span class="identifier-syntax">N</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax">=1; </span><span class="identifier-syntax">i</span><span class="plain-syntax">&lt;=</span><span class="identifier-syntax">N</span><span class="plain-syntax">; </span><span class="identifier-syntax">i</span><span class="plain-syntax">++) </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">local_var_names</span><span class="plain-syntax">, </span><span class="string-syntax">"x%d "</span><span class="plain-syntax">, </span><span class="identifier-syntax">i</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">body</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::duplicate</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"rfalse; ];"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">start</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::duplicate</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Str::truncate</span><span class="plain-syntax">(</span><span class="identifier-syntax">start</span><span class="plain-syntax">, </span><span class="constant-syntax">50</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">I6Errors::issue</span><span class="plain-syntax">(</span><span class="string-syntax">"invalid #Stub declaration: '%S'"</span><span class="plain-syntax">, </span><span class="identifier-syntax">start</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_3">&#167;4.3</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_3_3" class="paragraph-anchor"></a><b>&#167;4.3.3. </b>Function packages have a standardised shape in Inter, and though this is a
matter of convention rather than a requirement, we will follow it here. So
our <span class="extract"><span class="extract-syntax">Example</span></span> function would be called at <span class="extract"><span class="extract-syntax">/main/HypotheticalKit/functions/Example_fn/call</span></span>.
The following makes two packages:
</p>

<ul class="items"><li>(a) The "outer package", <span class="extract"><span class="extract-syntax">/main/HypotheticalKit/functions/Example_fn</span></span>, which
holds all resources other than code needed by the function; and within it
</li><li>(b) The "inner package", <span class="extract"><span class="extract-syntax">/main/HypotheticalKit/functions/Example_fn/Example</span></span>,
which contains the actual code.
</li></ul>
<p class="commentary">These have package types <span class="extract"><span class="extract-syntax">_function</span></span> and <span class="extract"><span class="extract-syntax">_code</span></span> respectively.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Turn this into a function package</span><span class="named-paragraph-number">4.3.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_bookmark</span><span class="plain-syntax"> </span><span class="identifier-syntax">content_at</span><span class="plain-syntax"> = </span><a href="3-css.html#SP7" class="function-link"><span class="function-syntax">CompileSplatsStage::make_submodule</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"functions"</span><span class="plain-syntax">, </span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_bookmark</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IBM</span><span class="plain-syntax"> = &amp;</span><span class="identifier-syntax">content_at</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">OP</span><span class="plain-syntax">, *</span><span class="identifier-syntax">IP</span><span class="plain-syntax">; </span><span class="comment-syntax"> outer and inner packages</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_3_3_1" class="named-paragraph-link"><span class="named-paragraph">Create the outer function package</span><span class="named-paragraph-number">4.3.3.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_3_3_2" class="named-paragraph-link"><span class="named-paragraph">Create an inner package for the code</span><span class="named-paragraph-number">4.3.3.2</span></a></span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_3">&#167;4.3</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_3_3_1" class="paragraph-anchor"></a><b>&#167;4.3.3.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Create the outer function package</span><span class="named-paragraph-number">4.3.3.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">fnt</span><span class="plain-syntax"> = </span><a href="2-rp.html#SP5" class="function-link"><span class="function-syntax">RunningPipelines::get_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="constant-syntax">function_ptype_RPSYM</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">fnt</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">fnt</span><span class="plain-syntax"> = </span><a href="2-rp.html#SP5" class="function-link"><span class="function-syntax">RunningPipelines::get_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="constant-syntax">plain_ptype_RPSYM</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">fname</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">fname</span><span class="plain-syntax">, </span><span class="string-syntax">"%S_fn"</span><span class="plain-syntax">, </span><span class="identifier-syntax">identifier</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">OP</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Produce::make_subpackage</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">fname</span><span class="plain-syntax">, </span><span class="identifier-syntax">fnt</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">fname</span><span class="plain-syntax">)</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_3_3">&#167;4.3.3</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_3_3_2" class="paragraph-anchor"></a><b>&#167;4.3.3.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Create an inner package for the code</span><span class="named-paragraph-number">4.3.3.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">InterBookmark::move_into_package</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">OP</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IP</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Produce::make_subpackage</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">identifier</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><a href="2-rp.html#SP5" class="function-link"><span class="function-syntax">RunningPipelines::get_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="constant-syntax">code_ptype_RPSYM</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Wiring::find_socket</span><span class="plain-syntax">(</span><span class="identifier-syntax">InterBookmark::tree</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">), </span><span class="identifier-syntax">identifier</span><span class="plain-syntax">) == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Wiring::socket</span><span class="plain-syntax">(</span><span class="identifier-syntax">InterBookmark::tree</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">), </span><span class="identifier-syntax">identifier</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">PackageInstruction::name_symbol</span><span class="plain-syntax">(</span><span class="identifier-syntax">IP</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><a href="3-css.html#SP5" class="function-link"><span class="function-syntax">CompileSplatsStage::apply_annotations</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">SplatInstruction::I6_annotation</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SplatInstruction::namespace</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">), </span><span class="identifier-syntax">PackageInstruction::name_symbol</span><span class="plain-syntax">(</span><span class="identifier-syntax">IP</span><span class="plain-syntax">));</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">inter_bookmark</span><span class="plain-syntax"> </span><span class="identifier-syntax">inner_save</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterBookmark::snapshot</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">InterBookmark::move_into_package</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">IP</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_bookmark</span><span class="plain-syntax"> </span><span class="identifier-syntax">block_bookmark</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterBookmark::snapshot</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">local_var_names</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_3_3_2_1" class="named-paragraph-link"><span class="named-paragraph">Create local variables within the inner package</span><span class="named-paragraph-number">4.3.3.2.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_3_3_2_2" class="named-paragraph-link"><span class="named-paragraph">Create the outermost code block inside the inner package</span><span class="named-paragraph-number">4.3.3.2.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">body</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_3_3_2_3" class="named-paragraph-link"><span class="named-paragraph">Compile actual code into this code block</span><span class="named-paragraph-number">4.3.3.2.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    *</span><span class="identifier-syntax">IBM</span><span class="plain-syntax"> = </span><span class="identifier-syntax">inner_save</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_3_3">&#167;4.3.3</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_3_3_2_1" class="paragraph-anchor"></a><b>&#167;4.3.3.2.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Create local variables within the inner package</span><span class="named-paragraph-number">4.3.3.2.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">string_position</span><span class="plain-syntax"> </span><span class="identifier-syntax">spos</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::start</span><span class="plain-syntax">(</span><span class="identifier-syntax">local_var_names</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">while</span><span class="plain-syntax"> (</span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">value</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP4_2_3_1_4_5_2_2_2" class="named-paragraph-link"><span class="named-paragraph">Extract a token</span><span class="named-paragraph-number">4.2.3.1.4.5.2.2.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">value</span><span class="plain-syntax">) == </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">invalid</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">i</span><span class="plain-syntax">&lt;</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">value</span><span class="plain-syntax">); </span><span class="identifier-syntax">i</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">inchar32_t</span><span class="plain-syntax"> </span><span class="identifier-syntax">c</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">value</span><span class="plain-syntax">, </span><span class="identifier-syntax">i</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">i</span><span class="plain-syntax"> == </span><span class="constant-syntax">0</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">Characters::isdigit</span><span class="plain-syntax">(</span><span class="identifier-syntax">c</span><span class="plain-syntax">))) </span><span class="identifier-syntax">invalid</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">c</span><span class="plain-syntax"> != </span><span class="character-syntax">'_'</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">Characters::isalnum</span><span class="plain-syntax">(</span><span class="identifier-syntax">c</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">                (</span><span class="identifier-syntax">Characters::isdigit</span><span class="plain-syntax">(</span><span class="identifier-syntax">c</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)) </span><span class="identifier-syntax">invalid</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">invalid</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">err</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::new</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">err</span><span class="plain-syntax">, </span><span class="string-syntax">"'%S' in function '%S'"</span><span class="plain-syntax">, </span><span class="identifier-syntax">value</span><span class="plain-syntax">, </span><span class="identifier-syntax">identifier</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">I6Errors::issue</span><span class="plain-syntax">(</span><span class="string-syntax">"invalid Inform 6 local variable name: %S"</span><span class="plain-syntax">, </span><span class="identifier-syntax">err</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">loc_name</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">InterSymbolsTable::create_with_unique_name</span><span class="plain-syntax">(</span><span class="identifier-syntax">InterPackage::scope</span><span class="plain-syntax">(</span><span class="identifier-syntax">IP</span><span class="plain-syntax">), </span><span class="identifier-syntax">value</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">InterSymbol::make_local</span><span class="plain-syntax">(</span><span class="identifier-syntax">loc_name</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">B</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">InterBookmark::baseline</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">) + </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Produce::guard</span><span class="plain-syntax">(</span><span class="identifier-syntax">LocalInstruction::new</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">loc_name</span><span class="plain-syntax">, </span><span class="identifier-syntax">InterTypes::unchecked</span><span class="plain-syntax">(), </span><span class="identifier-syntax">B</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">value</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_3_3_2">&#167;4.3.3.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_3_3_2_2" class="paragraph-anchor"></a><b>&#167;4.3.3.2.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Create the outermost code block inside the inner package</span><span class="named-paragraph-number">4.3.3.2.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">Produce::guard</span><span class="plain-syntax">(</span><span class="identifier-syntax">CodeInstruction::new</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        (</span><span class="reserved-syntax">int</span><span class="plain-syntax">) (</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">InterBookmark::baseline</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">) + </span><span class="constant-syntax">1</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">));</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_3_3_2">&#167;4.3.3.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP4_3_3_2_3" class="paragraph-anchor"></a><b>&#167;4.3.3.2.3. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Compile actual code into this code block</span><span class="named-paragraph-number">4.3.3.2.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">L</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">body</span><span class="plain-syntax">) - </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">while</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">L</span><span class="plain-syntax">&gt;0) &amp;&amp; (</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">body</span><span class="plain-syntax">, </span><span class="identifier-syntax">L</span><span class="plain-syntax">) != </span><span class="character-syntax">']'</span><span class="plain-syntax">)) </span><span class="identifier-syntax">L</span><span class="plain-syntax">--;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">while</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">L</span><span class="plain-syntax">&gt;0) &amp;&amp; (</span><span class="identifier-syntax">Characters::is_whitespace</span><span class="plain-syntax">(</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">body</span><span class="plain-syntax">, </span><span class="identifier-syntax">L</span><span class="plain-syntax">-1)))) </span><span class="identifier-syntax">L</span><span class="plain-syntax">--;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Str::truncate</span><span class="plain-syntax">(</span><span class="identifier-syntax">body</span><span class="plain-syntax">, </span><span class="identifier-syntax">L</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">B</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">InterBookmark::baseline</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">) + </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">text_provenance</span><span class="plain-syntax"> </span><span class="identifier-syntax">prov</span><span class="plain-syntax"> = </span><span class="identifier-syntax">I6Errors::get_current_location</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Provenance::advance_line</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">prov</span><span class="plain-syntax">, </span><span class="identifier-syntax">line_offset</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="3-css.html#SP13" class="function-link"><span class="function-syntax">CompileSplatsStage::function_body</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">css</span><span class="plain-syntax">, </span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">IP</span><span class="plain-syntax">, </span><span class="identifier-syntax">B</span><span class="plain-syntax">, </span><span class="identifier-syntax">body</span><span class="plain-syntax">, </span><span class="identifier-syntax">block_bookmark</span><span class="plain-syntax">, </span><span class="identifier-syntax">identifier</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SplatInstruction::namespace</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">), </span><span class="identifier-syntax">prov</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP4_3_3_2">&#167;4.3.3.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP5" class="paragraph-anchor"></a><b>&#167;5. Inform 6 annotations.</b></p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">CompileSplatsStage::apply_annotations</span><button class="popup" onclick="togglePopup('usagePopup6')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup6">Usage of <span class="code-font"><span class="function-syntax">CompileSplatsStage::apply_annotations</span></span>:<br/><a href="3-css.html#SP4_2_3_1">&#167;4.2.3.1</a>, <a href="3-css.html#SP4_3_3_2">&#167;4.3.3.2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">A</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">NS</span><span class="plain-syntax">, </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">S</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">apply_private</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NOT_APPLICABLE</span><span class="plain-syntax">, </span><span class="identifier-syntax">L</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">NS</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::get_last_char</span><span class="plain-syntax">(</span><span class="identifier-syntax">NS</span><span class="plain-syntax">) == </span><span class="character-syntax">'+'</span><span class="plain-syntax">) </span><span class="identifier-syntax">apply_private</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::get_last_char</span><span class="plain-syntax">(</span><span class="identifier-syntax">NS</span><span class="plain-syntax">) == </span><span class="character-syntax">'-'</span><span class="plain-syntax">) </span><span class="identifier-syntax">apply_private</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">apply_private</span><span class="plain-syntax"> != </span><span class="identifier-syntax">NOT_APPLICABLE</span><span class="plain-syntax">) </span><span class="identifier-syntax">L</span><span class="plain-syntax">--;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">N</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">L</span><span class="plain-syntax"> &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">i</span><span class="plain-syntax">&lt;</span><span class="identifier-syntax">L</span><span class="plain-syntax">; </span><span class="identifier-syntax">i</span><span class="plain-syntax">++) </span><span class="identifier-syntax">PUT_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">N</span><span class="plain-syntax">, </span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">NS</span><span class="plain-syntax">, </span><span class="identifier-syntax">i</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">LOGIF</span><span class="plain-syntax">(</span><span class="identifier-syntax">INTER_CONNECTORS</span><span class="plain-syntax">, </span><span class="string-syntax">"Assign namespace '%S' to $3\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">N</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">InterSymbol::set_namespace</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">N</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">A</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">LOGIF</span><span class="plain-syntax">(</span><span class="identifier-syntax">INTER_CONNECTORS</span><span class="plain-syntax">, </span><span class="string-syntax">"Trying to apply '%S' to $3\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">A</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">I6_annotation</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IA</span><span class="plain-syntax"> = </span><span class="identifier-syntax">I6Annotations::parse</span><span class="plain-syntax">(</span><span class="identifier-syntax">A</span><span class="plain-syntax">); </span><span class="identifier-syntax">IA</span><span class="plain-syntax">; </span><span class="identifier-syntax">IA</span><span class="plain-syntax"> = </span><span class="identifier-syntax">IA</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">next</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq_insensitive</span><span class="plain-syntax">(</span><span class="identifier-syntax">IA</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">identifier</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"private"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">IA</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">terms</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">LinkedLists::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">IA</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">terms</span><span class="plain-syntax">) == </span><span class="constant-syntax">0</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">                    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">apply_private</span><span class="plain-syntax"> == </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                        </span><span class="identifier-syntax">I6Errors::issue</span><span class="plain-syntax">(</span><span class="string-syntax">"the +private annotation is redundant in namespace '%S'"</span><span class="plain-syntax">, </span><span class="identifier-syntax">N</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">apply_private</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">I6Errors::issue</span><span class="plain-syntax">(</span>
<span class="plain-syntax">                        </span><span class="string-syntax">"the +private annotation does not take any terms"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                }</span>
<span class="plain-syntax">            } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq_insensitive</span><span class="plain-syntax">(</span><span class="identifier-syntax">IA</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">identifier</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"public"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">IA</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">terms</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">LinkedLists::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">IA</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">terms</span><span class="plain-syntax">) == </span><span class="constant-syntax">0</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">                    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">apply_private</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                        </span><span class="identifier-syntax">I6Errors::issue</span><span class="plain-syntax">(</span><span class="string-syntax">"the +public annotation is redundant in namespace '%S'"</span><span class="plain-syntax">, </span><span class="identifier-syntax">N</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">apply_private</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">I6Errors::issue</span><span class="plain-syntax">(</span>
<span class="plain-syntax">                        </span><span class="string-syntax">"the +public annotation does not take any terms"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                }</span>
<span class="plain-syntax">            } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq_insensitive</span><span class="plain-syntax">(</span><span class="identifier-syntax">IA</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">identifier</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"replacing"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">from</span><span class="plain-syntax"> = </span><span class="identifier-syntax">I</span><span class="string-syntax">"_"</span><span class="plain-syntax">; </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">keeping</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">IA</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">terms</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">I6_annotation_term</span><span class="plain-syntax"> *</span><span class="identifier-syntax">term</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">LOOP_OVER_LINKED_LIST</span><span class="plain-syntax">(</span><span class="identifier-syntax">term</span><span class="plain-syntax">, </span><span class="identifier-syntax">I6_annotation_term</span><span class="plain-syntax">, </span><span class="identifier-syntax">IA</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">terms</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq_insensitive</span><span class="plain-syntax">(</span><span class="identifier-syntax">term</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">key</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"from"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">                            </span><span class="identifier-syntax">from</span><span class="plain-syntax"> = </span><span class="identifier-syntax">term</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">value</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq_insensitive</span><span class="plain-syntax">(</span><span class="identifier-syntax">term</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">key</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">                            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">term</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">value</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"keeping"</span><span class="plain-syntax">)) </span><span class="identifier-syntax">keeping</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                            </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">                                </span><span class="identifier-syntax">I6Errors::issue</span><span class="plain-syntax">(</span>
<span class="plain-syntax">                                    </span><span class="string-syntax">"expected 'from K' or 'keeping' in '+replacing(...)', not '%S'"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                                    </span><span class="identifier-syntax">term</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">value</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                            }</span>
<span class="plain-syntax">                        } </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">                            </span><span class="identifier-syntax">I6Errors::issue</span><span class="plain-syntax">(</span>
<span class="plain-syntax">                                </span><span class="string-syntax">"the +replacing annotation does not take the term '%S'"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                                </span><span class="identifier-syntax">term</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">key</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                }</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">InterSymbol::set_replacement</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">from</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">keeping</span><span class="plain-syntax">) </span><span class="identifier-syntax">SymbolAnnotation::set_b</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">KEEPING_IANN</span><span class="plain-syntax">, </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq_insensitive</span><span class="plain-syntax">(</span><span class="identifier-syntax">IA</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">identifier</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"namespace"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">I6Errors::issue</span><span class="plain-syntax">(</span>
<span class="plain-syntax">                    </span><span class="string-syntax">"the annotation '%S' must be followed by a ';'"</span><span class="plain-syntax">, </span><span class="identifier-syntax">A</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">I6Errors::issue</span><span class="plain-syntax">(</span>
<span class="plain-syntax">                    </span><span class="string-syntax">"the annotation '+%S' is not one of those allowed"</span><span class="plain-syntax">, </span><span class="identifier-syntax">IA</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">identifier</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">apply_private</span><span class="plain-syntax"> == </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">) </span><span class="identifier-syntax">SymbolAnnotation::set_b</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">PRIVATE_IANN</span><span class="plain-syntax">, </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">N</span><span class="plain-syntax">)</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP6" class="paragraph-anchor"></a><b>&#167;6. Plumbing.</b>Some convenient Inter utilities.
</p>

<p class="commentary">First, we make a symbol, and also install a socket to it. This essentially
means that it will be visible to code outside of the current kit, making it a
function, variable or constant which can be called or accessed from other
kits or from the main program. (Compare C, where a function declared as <span class="extract"><span class="extract-syntax">static</span></span>
is visible only inside the current compilation unit; one declared without that
keyword can be linked to.)
</p>

<p class="commentary">Note that if there is already a socket of the same name, we do not attempt to
install another one. This will not in practice lead to problems, because the
identifiers supplied to this function all come from identifiers in Inter kits,
which have a single global namespace for functions and variables anyway.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="function-syntax">CompileSplatsStage::make_socketed_symbol</span><button class="popup" onclick="togglePopup('usagePopup7')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup7">Usage of <span class="code-font"><span class="function-syntax">CompileSplatsStage::make_socketed_symbol</span></span>:<br/><a href="3-css.html#SP4_2_3_1_2">&#167;4.2.3.1.2</a>, <a href="3-css.html#SP4_2_3_1_3">&#167;4.2.3.1.3</a>, <a href="3-css.html#SP4_2_3_1_4_5_3_1_3">&#167;4.2.3.1.4.5.3.1.3</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_bookmark</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">identifier</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">new_symbol</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterSymbolsTable::create_with_unique_name</span><span class="plain-syntax">(</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">InterBookmark::scope</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">), </span><span class="identifier-syntax">identifier</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Wiring::find_socket</span><span class="plain-syntax">(</span><span class="identifier-syntax">InterBookmark::tree</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">), </span><span class="identifier-syntax">identifier</span><span class="plain-syntax">) == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Wiring::socket</span><span class="plain-syntax">(</span><span class="identifier-syntax">InterBookmark::tree</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">), </span><span class="identifier-syntax">identifier</span><span class="plain-syntax">, </span><span class="identifier-syntax">new_symbol</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">new_symbol</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP7" class="paragraph-anchor"></a><b>&#167;7. </b>Syppose we are assimilating <span class="extract"><span class="extract-syntax">HypotheticalKit</span></span>, and we want to make sure that
the package <span class="extract"><span class="extract-syntax">/main/HypotheticalKit/whatevers</span></span> exists. Here <span class="extract"><span class="extract-syntax">/main/HypotheticalKit</span></span>
is a package of type <span class="extract"><span class="extract-syntax">_module</span></span>, and <span class="extract"><span class="extract-syntax">/main/HypotheticalKit/whatevers</span></span> should be
a <span class="extract"><span class="extract-syntax">_submodule</span></span>. Then we call this function, with <span class="extract"><span class="extract-syntax">name</span></span> set to "whatevers".
The return value is a bookmark to where we can write new code in the submodule.
</p>

<p class="commentary">Note that if the submodule already exists, there is nothing to create, and so
we simply return a bookmark at the end of the existing submodule.
</p>

<p class="commentary">The function tries to fail safe in the remote contingency that the package type
<span class="extract"><span class="extract-syntax">_submodule</span></span> does not exist in the current tree. But if the tree has been
properly initialised with the <span class="extract"><span class="extract-syntax">new</span></span> stage, then it will. Similarly, it will
fail safe if an assimilation package has not been set &mdash; but this is very
unlikely to happen: see above.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">inter_bookmark</span><span class="plain-syntax"> </span><span class="function-syntax">CompileSplatsStage::make_submodule</span><button class="popup" onclick="togglePopup('usagePopup8')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup8">Usage of <span class="code-font"><span class="function-syntax">CompileSplatsStage::make_submodule</span></span>:<br/><a href="3-css.html#SP4_2_3_1_1">&#167;4.2.3.1.1</a>, <a href="3-css.html#SP4_2_3_1_4_5_3_1">&#167;4.2.3.1.4.5.3.1</a>, <a href="3-css.html#SP4_3_3">&#167;4.3.3</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="reserved-syntax">pipeline_step</span><span class="plain-syntax"> *</span><span class="identifier-syntax">step</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">name</span><span class="plain-syntax">, </span><span class="identifier-syntax">inter_tree_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="2-rp.html#SP5" class="function-link"><span class="function-syntax">RunningPipelines::get_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="constant-syntax">submodule_ptype_RPSYM</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">module_pack</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">step</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">pipeline</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">ephemera</span><span class="plain-syntax">.</span><span class="element-syntax">assimilation_modules</span><span class="plain-syntax">[</span><span class="identifier-syntax">step</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">tree_argument</span><span class="plain-syntax">];</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">module_pack</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">submodule_package</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterPackage::from_name</span><span class="plain-syntax">(</span><span class="identifier-syntax">module_pack</span><span class="plain-syntax">, </span><span class="identifier-syntax">name</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">submodule_package</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">inter_bookmark</span><span class="plain-syntax"> </span><span class="identifier-syntax">IBM</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterBookmark::after_this_node</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">submodule_package</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Produce::make_subpackage</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">name</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                    </span><a href="2-rp.html#SP5" class="function-link"><span class="function-syntax">RunningPipelines::get_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="constant-syntax">submodule_ptype_RPSYM</span><span class="plain-syntax">));</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">submodule_package</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"could not create submodule"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterBookmark::at_end_of_this_package</span><span class="plain-syntax">(</span><span class="identifier-syntax">submodule_package</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterBookmark::after_this_node</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP8" class="paragraph-anchor"></a><b>&#167;8. Inform 6 expressions in constant context.</b>The following takes the text of a constant written in Inform 6 syntax, and
stored in <span class="extract"><span class="extract-syntax">S</span></span>, and compiles it to an Inter bytecode value pair. The meaning of
these depends on the package they will end up living in, so that must be supplied
as <span class="extract"><span class="extract-syntax">pack</span></span>.
</p>

<p class="commentary">The flag <span class="extract"><span class="extract-syntax">Verbal</span></span> is set if the expression came from a <span class="extract"><span class="extract-syntax">Verb</span></span> directive, i.e.,
from command parser grammar: slightly different syntax applies there.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">inter_pair</span><span class="plain-syntax"> </span><span class="function-syntax">CompileSplatsStage::value</span><button class="popup" onclick="togglePopup('usagePopup9')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup9">Usage of <span class="code-font"><span class="function-syntax">CompileSplatsStage::value</span></span>:<br/><a href="3-css.html#SP4_2_3_1_4_1_1">&#167;4.2.3.1.4.1.1</a>, <a href="3-css.html#SP4_2_3_1_4_5_3_2">&#167;4.2.3.1.4.5.3.2</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">pipeline_step</span><span class="plain-syntax"> *</span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">inter_bookmark</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">Verbal</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> *</span><span class="identifier-syntax">marker</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterBookmark::tree</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">from</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="identifier-syntax">to</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">)-1;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">from</span><span class="plain-syntax">) == </span><span class="character-syntax">'\''</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">to</span><span class="plain-syntax">) == </span><span class="character-syntax">'\''</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">to</span><span class="plain-syntax"> - </span><span class="identifier-syntax">from</span><span class="plain-syntax"> == </span><span class="constant-syntax">2</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP8_1" class="named-paragraph-link"><span class="named-paragraph">Parse this as a literal character</span><span class="named-paragraph-number">8.1</span></a></span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"'\\''"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP8_2" class="named-paragraph-link"><span class="named-paragraph">Parse this as a literal single quotation mark</span><span class="named-paragraph-number">8.2</span></a></span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP8_3" class="named-paragraph-link"><span class="named-paragraph">Parse this as a single-quoted command grammar word</span><span class="named-paragraph-number">8.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">from</span><span class="plain-syntax">) == </span><span class="character-syntax">'"'</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">to</span><span class="plain-syntax">) == </span><span class="character-syntax">'"'</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP8_4" class="named-paragraph-link"><span class="named-paragraph">Parse this as a double-quoted string literal</span><span class="named-paragraph-number">8.4</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (((</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">from</span><span class="plain-syntax">) == </span><span class="character-syntax">'$'</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">from</span><span class="plain-syntax">+1) == </span><span class="character-syntax">'+'</span><span class="plain-syntax">)) ||</span>
<span class="plain-syntax">        ((</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">from</span><span class="plain-syntax">) == </span><span class="character-syntax">'$'</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">from</span><span class="plain-syntax">+1) == </span><span class="character-syntax">'-'</span><span class="plain-syntax">)))</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP8_5" class="named-paragraph-link"><span class="named-paragraph">Parse this as a real literal</span><span class="named-paragraph-number">8.5</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP8_6" class="named-paragraph-link"><span class="named-paragraph">Attempt to parse this as a hex, binary or decimal literal</span><span class="named-paragraph-number">8.6</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP8_7" class="named-paragraph-link"><span class="named-paragraph">Attempt to parse this as a boolean literal</span><span class="named-paragraph-number">8.7</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Verbal</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP8_8" class="named-paragraph-link"><span class="named-paragraph">Attempt to parse this as a command grammar token</span><span class="named-paragraph-number">8.8</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP8_9" class="named-paragraph-link"><span class="named-paragraph">Attempt to parse this as an identifier name for something already defined by this kit</span><span class="named-paragraph-number">8.9</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP8_10" class="named-paragraph-link"><span class="named-paragraph">Parse this as a possibly computed value</span><span class="named-paragraph-number">8.10</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP8_1" class="paragraph-anchor"></a><b>&#167;8.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Parse this as a literal character</span><span class="named-paragraph-number">8.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">inchar32_t</span><span class="plain-syntax"> </span><span class="identifier-syntax">c</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">from</span><span class="plain-syntax"> + </span><span class="constant-syntax">1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterValuePairs::number</span><span class="plain-syntax">((</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">c</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP8">&#167;8</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP8_2" class="paragraph-anchor"></a><b>&#167;8.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Parse this as a literal single quotation mark</span><span class="named-paragraph-number">8.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterValuePairs::number</span><span class="plain-syntax">((</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="character-syntax">'\''</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP8">&#167;8</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP8_3" class="paragraph-anchor"></a><b>&#167;8.3. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Parse this as a single-quoted command grammar word</span><span class="named-paragraph-number">8.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">plural</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">; </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">before_slashes</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">dw</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_THROUGH_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">pos</span><span class="plain-syntax">.</span><span class="identifier-syntax">index</span><span class="plain-syntax"> &gt; </span><span class="identifier-syntax">from</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">pos</span><span class="plain-syntax">.</span><span class="identifier-syntax">index</span><span class="plain-syntax"> &lt; </span><span class="identifier-syntax">to</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Str::get</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">) == </span><span class="character-syntax">'/'</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">Str::get</span><span class="plain-syntax">(</span><span class="identifier-syntax">Str::forward</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">)) == </span><span class="character-syntax">'/'</span><span class="plain-syntax">))</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">before_slashes</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">before_slashes</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">PUT_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">dw</span><span class="plain-syntax">, </span><span class="identifier-syntax">Str::get</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">));</span>
<span class="plain-syntax">            } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::get</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">) == </span><span class="character-syntax">'p'</span><span class="plain-syntax">) </span><span class="identifier-syntax">plural</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_pair</span><span class="plain-syntax"> </span><span class="identifier-syntax">val</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">plural</span><span class="plain-syntax">) </span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterValuePairs::from_plural_dword</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">dw</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterValuePairs::from_singular_dword</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">dw</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">dw</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">val</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP8">&#167;8</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP8_4" class="paragraph-anchor"></a><b>&#167;8.4. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Parse this as a double-quoted string literal</span><span class="named-paragraph-number">8.4</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">dw</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_THROUGH_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">pos</span><span class="plain-syntax">.</span><span class="identifier-syntax">index</span><span class="plain-syntax"> &gt; </span><span class="identifier-syntax">from</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">pos</span><span class="plain-syntax">.</span><span class="identifier-syntax">index</span><span class="plain-syntax"> &lt; </span><span class="identifier-syntax">to</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">PUT_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">dw</span><span class="plain-syntax">, </span><span class="identifier-syntax">Str::get</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_pair</span><span class="plain-syntax"> </span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterValuePairs::from_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">dw</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">dw</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">val</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP8">&#167;8</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP8_5" class="paragraph-anchor"></a><b>&#167;8.5. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Parse this as a real literal</span><span class="named-paragraph-number">8.5</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">rw</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_THROUGH_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">pos</span><span class="plain-syntax">.</span><span class="identifier-syntax">index</span><span class="plain-syntax"> &gt; </span><span class="identifier-syntax">from</span><span class="plain-syntax"> + </span><span class="constant-syntax">1</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">pos</span><span class="plain-syntax">.</span><span class="identifier-syntax">index</span><span class="plain-syntax"> &lt;= </span><span class="identifier-syntax">to</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">PUT_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">rw</span><span class="plain-syntax">, </span><span class="identifier-syntax">Str::get</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_pair</span><span class="plain-syntax"> </span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterValuePairs::real_from_I6_notation</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">rw</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">rw</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">val</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP8">&#167;8</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP8_6" class="paragraph-anchor"></a><b>&#167;8.6. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Attempt to parse this as a hex, binary or decimal literal</span><span class="named-paragraph-number">8.6</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">sign</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">, </span><span class="identifier-syntax">bad</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">unsigned</span><span class="plain-syntax"> </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">base</span><span class="plain-syntax"> = </span><span class="constant-syntax">10</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">from</span><span class="plain-syntax">) == </span><span class="character-syntax">'('</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">to</span><span class="plain-syntax">) == </span><span class="character-syntax">')'</span><span class="plain-syntax">)) { </span><span class="identifier-syntax">from</span><span class="plain-syntax">++; </span><span class="identifier-syntax">to</span><span class="plain-syntax">--; }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">while</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Characters::is_whitespace</span><span class="plain-syntax">(</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">from</span><span class="plain-syntax">))) </span><span class="identifier-syntax">from</span><span class="plain-syntax">++;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">while</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Characters::is_whitespace</span><span class="plain-syntax">(</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">to</span><span class="plain-syntax">))) </span><span class="identifier-syntax">to</span><span class="plain-syntax">--;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">from</span><span class="plain-syntax">) == </span><span class="character-syntax">'-'</span><span class="plain-syntax">) { </span><span class="identifier-syntax">sign</span><span class="plain-syntax"> = -1; </span><span class="identifier-syntax">from</span><span class="plain-syntax">++; }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">from</span><span class="plain-syntax">) == </span><span class="character-syntax">'$'</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">from</span><span class="plain-syntax">++; </span><span class="identifier-syntax">base</span><span class="plain-syntax"> = </span><span class="constant-syntax">16</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">from</span><span class="plain-syntax">) == </span><span class="character-syntax">'$'</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">from</span><span class="plain-syntax">++; </span><span class="identifier-syntax">base</span><span class="plain-syntax"> = </span><span class="constant-syntax">2</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">long</span><span class="plain-syntax"> </span><span class="reserved-syntax">long</span><span class="plain-syntax"> </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">N</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_THROUGH_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">pos</span><span class="plain-syntax">.</span><span class="identifier-syntax">index</span><span class="plain-syntax"> &lt; </span><span class="identifier-syntax">from</span><span class="plain-syntax">) </span><span class="reserved-syntax">continue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">pos</span><span class="plain-syntax">.</span><span class="identifier-syntax">index</span><span class="plain-syntax"> &gt; </span><span class="identifier-syntax">to</span><span class="plain-syntax">) </span><span class="reserved-syntax">continue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inchar32_t</span><span class="plain-syntax"> </span><span class="identifier-syntax">c</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::get</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">), </span><span class="identifier-syntax">d</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">c</span><span class="plain-syntax"> &gt;= </span><span class="character-syntax">'a'</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">c</span><span class="plain-syntax"> &lt;= </span><span class="character-syntax">'z'</span><span class="plain-syntax">)) </span><span class="identifier-syntax">d</span><span class="plain-syntax"> = </span><span class="identifier-syntax">c</span><span class="plain-syntax">-</span><span class="character-syntax">'a'</span><span class="plain-syntax">+10;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">c</span><span class="plain-syntax"> &gt;= </span><span class="character-syntax">'A'</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">c</span><span class="plain-syntax"> &lt;= </span><span class="character-syntax">'Z'</span><span class="plain-syntax">)) </span><span class="identifier-syntax">d</span><span class="plain-syntax"> = </span><span class="identifier-syntax">c</span><span class="plain-syntax">-</span><span class="character-syntax">'A'</span><span class="plain-syntax">+10;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">c</span><span class="plain-syntax"> &gt;= </span><span class="character-syntax">'0'</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">c</span><span class="plain-syntax"> &lt;= </span><span class="character-syntax">'9'</span><span class="plain-syntax">)) </span><span class="identifier-syntax">d</span><span class="plain-syntax"> = </span><span class="identifier-syntax">c</span><span class="plain-syntax">-</span><span class="character-syntax">'0'</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> { </span><span class="identifier-syntax">bad</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">d</span><span class="plain-syntax"> &gt; </span><span class="identifier-syntax">base</span><span class="plain-syntax">) { </span><span class="identifier-syntax">bad</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">N</span><span class="plain-syntax"> = </span><span class="identifier-syntax">base</span><span class="plain-syntax">*</span><span class="identifier-syntax">N</span><span class="plain-syntax"> + (</span><span class="reserved-syntax">long</span><span class="plain-syntax"> </span><span class="reserved-syntax">long</span><span class="plain-syntax"> </span><span class="reserved-syntax">int</span><span class="plain-syntax">) </span><span class="identifier-syntax">d</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">pos</span><span class="plain-syntax">.</span><span class="identifier-syntax">index</span><span class="plain-syntax"> &gt; </span><span class="constant-syntax">34</span><span class="plain-syntax">) { </span><span class="identifier-syntax">bad</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">bad</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">N</span><span class="plain-syntax"> = </span><span class="identifier-syntax">sign</span><span class="plain-syntax">*</span><span class="identifier-syntax">N</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterValuePairs::number</span><span class="plain-syntax">((</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">N</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP8">&#167;8</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP8_7" class="paragraph-anchor"></a><b>&#167;8.7. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Attempt to parse this as a boolean literal</span><span class="named-paragraph-number">8.7</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"true"</span><span class="plain-syntax">))  </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterValuePairs::number</span><span class="plain-syntax">(1);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"false"</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterValuePairs::number</span><span class="plain-syntax">(0);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP8">&#167;8</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP8_8" class="paragraph-anchor"></a><b>&#167;8.8. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Attempt to parse this as a command grammar token</span><span class="named-paragraph-number">8.8</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"*"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterValuePairs::symbolic</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><a href="2-rp.html#SP6" class="function-link"><span class="function-syntax">RunningPipelines::ensure_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="constant-syntax">verb_directive_divider_RPSYM</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"VERB_DIRECTIVE_DIVIDER"</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"-&gt;"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterValuePairs::symbolic</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><a href="2-rp.html#SP6" class="function-link"><span class="function-syntax">RunningPipelines::ensure_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="constant-syntax">verb_directive_result_RPSYM</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"VERB_DIRECTIVE_RESULT"</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"reverse"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterValuePairs::symbolic</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><a href="2-rp.html#SP6" class="function-link"><span class="function-syntax">RunningPipelines::ensure_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="constant-syntax">verb_directive_reverse_RPSYM</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"VERB_DIRECTIVE_REVERSE"</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"/"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterValuePairs::symbolic</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><a href="2-rp.html#SP6" class="function-link"><span class="function-syntax">RunningPipelines::ensure_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="constant-syntax">verb_directive_slash_RPSYM</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"VERB_DIRECTIVE_SLASH"</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"special"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterValuePairs::symbolic</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><a href="2-rp.html#SP6" class="function-link"><span class="function-syntax">RunningPipelines::ensure_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="constant-syntax">verb_directive_special_RPSYM</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"VERB_DIRECTIVE_SPECIAL"</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"number"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterValuePairs::symbolic</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><a href="2-rp.html#SP6" class="function-link"><span class="function-syntax">RunningPipelines::ensure_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="constant-syntax">verb_directive_number_RPSYM</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"VERB_DIRECTIVE_NUMBER"</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"noun"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterValuePairs::symbolic</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><a href="2-rp.html#SP6" class="function-link"><span class="function-syntax">RunningPipelines::ensure_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="constant-syntax">verb_directive_noun_RPSYM</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"VERB_DIRECTIVE_NOUN"</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"multi"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterValuePairs::symbolic</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><a href="2-rp.html#SP6" class="function-link"><span class="function-syntax">RunningPipelines::ensure_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="constant-syntax">verb_directive_multi_RPSYM</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"VERB_DIRECTIVE_MULTI"</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"multiinside"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterValuePairs::symbolic</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><a href="2-rp.html#SP6" class="function-link"><span class="function-syntax">RunningPipelines::ensure_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="constant-syntax">verb_directive_multiinside_RPSYM</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"VERB_DIRECTIVE_MULTIINSIDE"</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"multiheld"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterValuePairs::symbolic</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><a href="2-rp.html#SP6" class="function-link"><span class="function-syntax">RunningPipelines::ensure_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="constant-syntax">verb_directive_multiheld_RPSYM</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"VERB_DIRECTIVE_MULTIHELD"</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"held"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterValuePairs::symbolic</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><a href="2-rp.html#SP6" class="function-link"><span class="function-syntax">RunningPipelines::ensure_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="constant-syntax">verb_directive_held_RPSYM</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"VERB_DIRECTIVE_HELD"</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"creature"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterValuePairs::symbolic</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><a href="2-rp.html#SP6" class="function-link"><span class="function-syntax">RunningPipelines::ensure_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="constant-syntax">verb_directive_creature_RPSYM</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"VERB_DIRECTIVE_CREATURE"</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"topic"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterValuePairs::symbolic</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><a href="2-rp.html#SP6" class="function-link"><span class="function-syntax">RunningPipelines::ensure_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="constant-syntax">verb_directive_topic_RPSYM</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"VERB_DIRECTIVE_TOPIC"</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"multiexcept"</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterValuePairs::symbolic</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><a href="2-rp.html#SP6" class="function-link"><span class="function-syntax">RunningPipelines::ensure_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="constant-syntax">verb_directive_multiexcept_RPSYM</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"VERB_DIRECTIVE_MULTIEXCEPT"</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">match_results</span><span class="plain-syntax"> </span><span class="identifier-syntax">mr</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Regexp::create_mr</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"scope=([A-Za-z0-9_`]+)"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">symb</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Wiring::cable_end</span><span class="plain-syntax">(</span><span class="identifier-syntax">Wiring::find_socket</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0]));</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">symb</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">marker</span><span class="plain-syntax">) *</span><span class="identifier-syntax">marker</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterValuePairs::symbolic</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">symb</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">I6Errors::issue</span><span class="plain-syntax">(</span><span class="string-syntax">"can't find any scope routine called '%S'"</span><span class="plain-syntax">, </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0]);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterValuePairs::number</span><span class="plain-syntax">(1);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"noun=([A-Za-z0-9_`]+)"</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">symb</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Wiring::cable_end</span><span class="plain-syntax">(</span><span class="identifier-syntax">Wiring::find_socket</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0]));</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">symb</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">marker</span><span class="plain-syntax">) *</span><span class="identifier-syntax">marker</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterValuePairs::symbolic</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">symb</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">I6Errors::issue</span><span class="plain-syntax">(</span><span class="string-syntax">"can't find any noun routine called '%S'"</span><span class="plain-syntax">, </span><span class="identifier-syntax">mr</span><span class="plain-syntax">.</span><span class="identifier-syntax">exp</span><span class="plain-syntax">[0]);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterValuePairs::number</span><span class="plain-syntax">(1);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP8">&#167;8</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP8_9" class="paragraph-anchor"></a><b>&#167;8.9. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Attempt to parse this as an identifier name for something already defined by this kit</span><span class="named-paragraph-number">8.9</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">symb</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Wiring::find_socket</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">symb</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterValuePairs::symbolic</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">symb</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP8">&#167;8</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP8_10" class="paragraph-anchor"></a><b>&#167;8.10. </b>At this point, maybe the reason we haven't yet recognised the constant <span class="extract"><span class="extract-syntax">S</span></span> is
that it's a computation like <span class="extract"><span class="extract-syntax">6 + MAX_WEEBLES*4</span></span>. This is quite legal in Inform 6,
and the compiler performs constant-folding to evaluate them: so that's what we will
emulate now. In practice, we are only going to understand fairly simple computations,
but that will be enough for the kits normally used with Inform.
</p>

<p class="commentary">We do this by parsing <span class="extract"><span class="extract-syntax">S</span></span> into a schema, whose tree will look roughly like this:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">PLUS_BIP</span>
<span class="plain-syntax">        </span><span class="constant-syntax">6</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">TIMES_BIP</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">MAX_WEEBLES</span>
<span class="plain-syntax">            </span><span class="constant-syntax">4</span>
</pre>
<p class="commentary">We then recurse down through this tree, constructing an Inter symbol for a
constant which evaluates to the result of each operation. Here, then, we
first define <span class="extract"><span class="extract-syntax">Computed_Constant_Value_1</span></span> as the multiplication, then define
<span class="extract"><span class="extract-syntax">Computed_Constant_Value_2</span></span> as the addition, and that is what we use as our
answer. Since we recurse depth-first, the subsidiary results are always made
before they are needed.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Parse this as a possibly computed value</span><span class="named-paragraph-number">8.10</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_schema</span><span class="plain-syntax"> *</span><span class="identifier-syntax">sch</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">ParsingSchemas::from_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">I6Errors::get_current_location</span><span class="plain-syntax">());</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">excess_tokens</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">result_s</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">        </span><a href="3-css.html#SP9" class="function-link"><span class="function-syntax">CompileSplatsStage::compute_r</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">sch</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">node_tree</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">excess_tokens</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">result_s</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) { </span><span class="comment-syntax"> a precaution, but should no longer happen</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">I6Errors::issue</span><span class="plain-syntax">(</span><span class="string-syntax">"Inform 6 constant too complex"</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterValuePairs::number</span><span class="plain-syntax">(1);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterValuePairs::symbolic</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">result_s</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP8">&#167;8</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP9" class="paragraph-anchor"></a><b>&#167;9. </b>So this is the recursion. Note that we calculate \(-x\) as \(0 - x\), thus
reducing unary subtraction to a case of binary subtraction.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="function-syntax">CompileSplatsStage::compute_r</span><button class="popup" onclick="togglePopup('usagePopup10')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup10">Usage of <span class="code-font"><span class="function-syntax">CompileSplatsStage::compute_r</span></span>:<br/><a href="3-css.html#SP8_10">&#167;8.10</a>, <a href="3-css.html#SP9_1">&#167;9.1</a>, <a href="3-css.html#SP9_2">&#167;9.2</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">pipeline_step</span><span class="plain-syntax"> *</span><span class="identifier-syntax">step</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_bookmark</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">inter_schema_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">isn</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> *</span><span class="identifier-syntax">excess_tokens</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">isn</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">isn</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">isn_type</span><span class="plain-syntax"> == </span><span class="identifier-syntax">SUBEXPRESSION_ISNT</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="3-css.html#SP9" class="function-link"><span class="function-syntax">CompileSplatsStage::compute_r</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">isn</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">child_node</span><span class="plain-syntax">, </span><span class="identifier-syntax">excess_tokens</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">isn</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">isn_type</span><span class="plain-syntax"> == </span><span class="identifier-syntax">OPERATION_ISNT</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">op</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">isn</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">isn_clarifier</span><span class="plain-syntax"> == </span><span class="identifier-syntax">PLUS_BIP</span><span class="plain-syntax">) </span><span class="identifier-syntax">op</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CONST_LIST_FORMAT_SUM</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">isn</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">isn_clarifier</span><span class="plain-syntax"> == </span><span class="identifier-syntax">TIMES_BIP</span><span class="plain-syntax">) </span><span class="identifier-syntax">op</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CONST_LIST_FORMAT_PRODUCT</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">isn</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">isn_clarifier</span><span class="plain-syntax"> == </span><span class="identifier-syntax">MINUS_BIP</span><span class="plain-syntax">) </span><span class="identifier-syntax">op</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CONST_LIST_FORMAT_DIFFERENCE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">isn</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">isn_clarifier</span><span class="plain-syntax"> == </span><span class="identifier-syntax">DIVIDE_BIP</span><span class="plain-syntax">) </span><span class="identifier-syntax">op</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CONST_LIST_FORMAT_QUOTIENT</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">isn</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">isn_clarifier</span><span class="plain-syntax"> == </span><span class="identifier-syntax">UNARYMINUS_BIP</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP9_2" class="named-paragraph-link"><span class="named-paragraph">Calculate unary minus</span><span class="named-paragraph-number">9.2</span></a></span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP9_1" class="named-paragraph-link"><span class="named-paragraph">Calculate binary operation</span><span class="named-paragraph-number">9.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">isn</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">isn_type</span><span class="plain-syntax"> == </span><span class="identifier-syntax">EXPRESSION_ISNT</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_schema_token</span><span class="plain-syntax"> *</span><span class="identifier-syntax">t</span><span class="plain-syntax"> = </span><span class="identifier-syntax">isn</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">expression_tokens</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">t</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">next</span><span class="plain-syntax">)) { *</span><span class="identifier-syntax">excess_tokens</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="3-css.html#SP11" class="function-link"><span class="function-syntax">CompileSplatsStage::compute_eval</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">t</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP9_1" class="paragraph-anchor"></a><b>&#167;9.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Calculate binary operation</span><span class="named-paragraph-number">9.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">i1</span><span class="plain-syntax"> = </span><a href="3-css.html#SP9" class="function-link"><span class="function-syntax">CompileSplatsStage::compute_r</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">isn</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">child_node</span><span class="plain-syntax">, </span><span class="identifier-syntax">excess_tokens</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">i2</span><span class="plain-syntax"> = </span><a href="3-css.html#SP9" class="function-link"><span class="function-syntax">CompileSplatsStage::compute_r</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">isn</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">child_node</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">next_node</span><span class="plain-syntax">, </span><span class="identifier-syntax">excess_tokens</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">i1</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">i2</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="3-css.html#SP10" class="function-link"><span class="function-syntax">CompileSplatsStage::compute_binary_op</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">op</span><span class="plain-syntax">, </span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">i1</span><span class="plain-syntax">, </span><span class="identifier-syntax">i2</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP9">&#167;9</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP9_2" class="paragraph-anchor"></a><b>&#167;9.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Calculate unary minus</span><span class="named-paragraph-number">9.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">i2</span><span class="plain-syntax"> = </span><a href="3-css.html#SP9" class="function-link"><span class="function-syntax">CompileSplatsStage::compute_r</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">isn</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">child_node</span><span class="plain-syntax">, </span><span class="identifier-syntax">excess_tokens</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">i2</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="3-css.html#SP10" class="function-link"><span class="function-syntax">CompileSplatsStage::compute_binary_op</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">CONST_LIST_FORMAT_DIFFERENCE</span><span class="plain-syntax">, </span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">i2</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP9">&#167;9</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP10" class="paragraph-anchor"></a><b>&#167;10. </b>The binary operation \(x + y\) is "calculated" by forming a constant list with
two entries, \(x\) and \(y\), and marking this list in Inter as a list whose meaning
is the sum of the entries. (And similarly for the other three operations.) This
is a sort of lazy evaluation: it means that the actual calculation will be done
in whatever context Inter is being compiled for &mdash; for example, if all of this
Inter is compiled to ANSI C, then it will eventually be a C compiler which
actually works out the numerical value of \(x + y\).
</p>

<p class="commentary">Why do we do this? Why not simply calculate now, and get an explicit answer?
The trouble is that one of \(x\) or \(y\) might be some symbol whose value is itself
created by the downstream compiler. The meaning of this is the same on all
platforms: the value is not.
</p>

<p class="commentary">There would be a case for optimising the following function to fold constants
in cases where we can confidently do so (being careful of overflows and
mindful of the word size), i.e., when \(x\) and \(y\) are literal numbers or
symbols defined as literal numbers. That would produce more elegant Inter.
But not really more efficient Inter.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="function-syntax">CompileSplatsStage::compute_binary_op</span><button class="popup" onclick="togglePopup('usagePopup11')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup11">Usage of <span class="code-font"><span class="function-syntax">CompileSplatsStage::compute_binary_op</span></span>:<br/><a href="3-css.html#SP9_1">&#167;9.1</a>, <a href="3-css.html#SP9_2">&#167;9.2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">op</span><span class="plain-syntax">, </span><span class="reserved-syntax">pipeline_step</span><span class="plain-syntax"> *</span><span class="identifier-syntax">step</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_bookmark</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">i1</span><span class="plain-syntax">, </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">i2</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pack</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterBookmark::package</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">result_s</span><span class="plain-syntax"> = </span><a href="3-css.html#SP12" class="function-link"><span class="function-syntax">CompileSplatsStage::new_ccv_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">pack</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">MID</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterSymbolsTable::id_at_bookmark</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">result_s</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">KID</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterTypes::to_TID</span><span class="plain-syntax">(</span><span class="identifier-syntax">InterBookmark::scope</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">), </span><span class="identifier-syntax">InterTypes::unchecked</span><span class="plain-syntax">());</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">B</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">InterBookmark::baseline</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">) + </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_tree_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pair_list</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Inode::new_with_3_data_fields</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">CONSTANT_IST</span><span class="plain-syntax">, </span><span class="identifier-syntax">MID</span><span class="plain-syntax">, </span><span class="identifier-syntax">KID</span><span class="plain-syntax">, </span><span class="identifier-syntax">op</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">B</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">pos</span><span class="plain-syntax"> = </span><span class="identifier-syntax">pair_list</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">W</span><span class="plain-syntax">.</span><span class="identifier-syntax">extent</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Inode::extend_instruction_by</span><span class="plain-syntax">(</span><span class="identifier-syntax">pair_list</span><span class="plain-syntax">, </span><span class="constant-syntax">4</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">i1</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">InterValuePairs::set</span><span class="plain-syntax">(</span><span class="identifier-syntax">pair_list</span><span class="plain-syntax">, </span><span class="identifier-syntax">pos</span><span class="plain-syntax">, </span><span class="identifier-syntax">InterValuePairs::symbolic</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">i1</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">InterValuePairs::set</span><span class="plain-syntax">(</span><span class="identifier-syntax">pair_list</span><span class="plain-syntax">, </span><span class="identifier-syntax">pos</span><span class="plain-syntax">, </span><span class="identifier-syntax">InterValuePairs::number</span><span class="plain-syntax">(0));</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">i2</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">InterValuePairs::set</span><span class="plain-syntax">(</span><span class="identifier-syntax">pair_list</span><span class="plain-syntax">, </span><span class="identifier-syntax">pos</span><span class="plain-syntax">+2, </span><span class="identifier-syntax">InterValuePairs::symbolic</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">i2</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">InterValuePairs::set</span><span class="plain-syntax">(</span><span class="identifier-syntax">pair_list</span><span class="plain-syntax">, </span><span class="identifier-syntax">pos</span><span class="plain-syntax">+2, </span><span class="identifier-syntax">InterValuePairs::number</span><span class="plain-syntax">(0));</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Produce::guard</span><span class="plain-syntax">(</span><span class="identifier-syntax">VerifyingInter::instruction</span><span class="plain-syntax">(</span><span class="identifier-syntax">InterBookmark::package</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">), </span><span class="identifier-syntax">pair_list</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">NodePlacement::move_to_moving_bookmark</span><span class="plain-syntax">(</span><span class="identifier-syntax">pair_list</span><span class="plain-syntax">, </span><span class="identifier-syntax">IBM</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">result_s</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP11" class="paragraph-anchor"></a><b>&#167;11. </b>So much for recursing down through the nodes of the Inter schema. Here are
the leaves:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="function-syntax">CompileSplatsStage::compute_eval</span><button class="popup" onclick="togglePopup('usagePopup12')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup12">Usage of <span class="code-font"><span class="function-syntax">CompileSplatsStage::compute_eval</span></span>:<br/><a href="3-css.html#SP9">&#167;9</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">pipeline_step</span><span class="plain-syntax"> *</span><span class="identifier-syntax">step</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_bookmark</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">inter_schema_token</span><span class="plain-syntax"> *</span><span class="identifier-syntax">t</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterBookmark::tree</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ist_type</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">NUMBER_ISTT:</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">BIN_NUMBER_ISTT:</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">HEX_NUMBER_ISTT:</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP11_1" class="named-paragraph-link"><span class="named-paragraph">This leaf is a literal number of some kind</span><span class="named-paragraph-number">11.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">IDENTIFIER_ISTT:</span><span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP11_2" class="named-paragraph-link"><span class="named-paragraph">This leaf is a symbol name</span><span class="named-paragraph-number">11.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP11_1" class="paragraph-anchor"></a><b>&#167;11.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">This leaf is a literal number of some kind</span><span class="named-paragraph-number">11.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pack</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterBookmark::package</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_pair</span><span class="plain-syntax"> </span><span class="identifier-syntax">val</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">constant_number</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterValuePairs::number</span><span class="plain-syntax">((</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">constant_number</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterValuePairs::number_from_I6_notation</span><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">material</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">InterValuePairs::is_undef</span><span class="plain-syntax">(</span><span class="identifier-syntax">val</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">result_s</span><span class="plain-syntax"> = </span><a href="3-css.html#SP12" class="function-link"><span class="function-syntax">CompileSplatsStage::new_ccv_symbol</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">pack</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">B</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">InterBookmark::baseline</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">) + </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Produce::guard</span><span class="plain-syntax">(</span><span class="identifier-syntax">ConstantInstruction::new</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">result_s</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">InterTypes::unchecked</span><span class="plain-syntax">(), </span><span class="identifier-syntax">val</span><span class="plain-syntax">, </span><span class="identifier-syntax">B</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">result_s</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP11">&#167;11</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP11_2" class="paragraph-anchor"></a><b>&#167;11.2. </b>This is the harder case by far, despite the brevity of the following code.
Here we run into, say, <span class="extract"><span class="extract-syntax">MAX_ELEPHANTS</span></span>, some identifier which clearly refers
to something defined elsewhere. If it has already been defined in the kit
being compiled, then there's a socket of that name already, and we can use
that as the answer; similarly if it's an architectural constant such as <span class="extract"><span class="extract-syntax">WORDSIZE</span></span>.
Otherwise we must assume it will be declared either later or in another
compilation unit, so we create a plug called <span class="extract"><span class="extract-syntax">MAX_ELEPHANTS</span></span> and let the
linker stage worry about what it means later on.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">This leaf is a symbol name</span><span class="named-paragraph-number">11.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">result_s</span><span class="plain-syntax"> = </span><span class="identifier-syntax">LargeScale::find_architectural_symbol</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">material</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">result_s</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">result_s</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">result_s</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Wiring::find_socket</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">material</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">result_s</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">result_s</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">Wiring::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">material</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP11">&#167;11</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP12" class="paragraph-anchor"></a><b>&#167;12. </b>The above algorithm needs a lot of names for partial results of expressions,
all of which have to become Inter symbols. It really doesn't matter what these
are called.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">ccs_count</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="function-syntax">CompileSplatsStage::new_ccv_symbol</span><button class="popup" onclick="togglePopup('usagePopup13')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup13">Usage of <span class="code-font"><span class="function-syntax">CompileSplatsStage::new_ccv_symbol</span></span>:<br/><a href="3-css.html#SP10">&#167;10</a>, <a href="3-css.html#SP11_1">&#167;11.1</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pack</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">NN</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">NN</span><span class="plain-syntax">, </span><span class="string-syntax">"Computed_Constant_Value_%d"</span><span class="plain-syntax">, </span><span class="identifier-syntax">ccs_count</span><span class="plain-syntax">++);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">result_s</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">InterSymbolsTable::symbol_from_name_creating</span><span class="plain-syntax">(</span><span class="identifier-syntax">InterPackage::scope</span><span class="plain-syntax">(</span><span class="identifier-syntax">pack</span><span class="plain-syntax">), </span><span class="identifier-syntax">NN</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">InterSymbol::set_flag</span><span class="plain-syntax">(</span><span class="identifier-syntax">result_s</span><span class="plain-syntax">, </span><span class="identifier-syntax">MAKE_NAME_UNIQUE_ISYMF</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">NN</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">result_s</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP13" class="paragraph-anchor"></a><b>&#167;13. Delegating the work of compiling function bodies.</b>Function bodies are by far the hardest things to compile. We delegate this first
by storing up a list of requests to do the work:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">typedef</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">function_body_request</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">inter_bookmark</span><span class="plain-syntax"> </span><span class="identifier-syntax">position</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">inter_bookmark</span><span class="plain-syntax"> </span><span class="identifier-syntax">block_bookmark</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">package_request</span><span class="plain-syntax"> *</span><span class="identifier-syntax">enclosure</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">block_package</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">pass2_offset</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">body</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">identifier</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">namespace</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">text_provenance</span><span class="plain-syntax"> </span><span class="identifier-syntax">provenance</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">CLASS_DEFINITION</span>
<span class="plain-syntax">} </span><span class="reserved-syntax">function_body_request</span><span class="plain-syntax">;</span>

<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">CompileSplatsStage::function_body</span><button class="popup" onclick="togglePopup('usagePopup14')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup14">Usage of <span class="code-font"><span class="function-syntax">CompileSplatsStage::function_body</span></span>:<br/><a href="3-css.html#SP4_3_3_2_3">&#167;4.3.3.2.3</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">compile_splats_state</span><span class="plain-syntax"> *</span><span class="identifier-syntax">css</span><span class="plain-syntax">, </span><span class="identifier-syntax">inter_bookmark</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">block_package</span><span class="plain-syntax">, </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">offset</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">body</span><span class="plain-syntax">, </span><span class="identifier-syntax">inter_bookmark</span><span class="plain-syntax"> </span><span class="identifier-syntax">bb</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">identifier</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">namespace</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_provenance</span><span class="plain-syntax"> </span><span class="identifier-syntax">provenance</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::is_whitespace</span><span class="plain-syntax">(</span><span class="identifier-syntax">body</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">function_body_request</span><span class="plain-syntax"> *</span><span class="identifier-syntax">req</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CREATE</span><span class="plain-syntax">(</span><span class="reserved-syntax">function_body_request</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">block_bookmark</span><span class="plain-syntax"> = </span><span class="identifier-syntax">bb</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">enclosure</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Packaging::enclosure</span><span class="plain-syntax">(</span><span class="identifier-syntax">InterBookmark::tree</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">position</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Packaging::bubble_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">block_package</span><span class="plain-syntax"> = </span><span class="identifier-syntax">block_package</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">pass2_offset</span><span class="plain-syntax"> = (</span><span class="reserved-syntax">int</span><span class="plain-syntax">) </span><span class="identifier-syntax">offset</span><span class="plain-syntax"> - </span><span class="constant-syntax">2</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">body</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::duplicate</span><span class="plain-syntax">(</span><span class="identifier-syntax">body</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">identifier</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::duplicate</span><span class="plain-syntax">(</span><span class="identifier-syntax">identifier</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">namespace</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::duplicate</span><span class="plain-syntax">(</span><span class="identifier-syntax">namespace</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">provenance</span><span class="plain-syntax"> = </span><span class="identifier-syntax">provenance</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ADD_TO_LINKED_LIST</span><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">, </span><span class="reserved-syntax">function_body_request</span><span class="plain-syntax">, </span><span class="identifier-syntax">css</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">function_bodies_to_compile</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<ul class="endnotetexts"><li>The structure function_body_request is accessed in 3/ps and here.</li></ul>
<p class="commentary firstcommentary"><a id="SP14" class="paragraph-anchor"></a><b>&#167;14. </b>...Playing back through those requests here. Note that we turn the entire
contents of the function &mdash; which can be very large, for example in the Inform
kit <span class="extract"><span class="extract-syntax">CommandParserKit</span></span> &mdash; as a single gigantic Inter schema <span class="extract"><span class="extract-syntax">sch</span></span>.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">CompileSplatsStage::function_bodies</span><button class="popup" onclick="togglePopup('usagePopup15')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup15">Usage of <span class="code-font"><span class="function-syntax">CompileSplatsStage::function_bodies</span></span>:<br/><a href="3-css.html#SP2">&#167;2</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">pipeline_step</span><span class="plain-syntax"> *</span><span class="identifier-syntax">step</span><span class="plain-syntax">, </span><span class="reserved-syntax">compile_splats_state</span><span class="plain-syntax"> *</span><span class="identifier-syntax">css</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">errors_occurred</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">function_body_request</span><span class="plain-syntax"> *</span><span class="identifier-syntax">req</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER_LINKED_LIST</span><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">, </span><span class="reserved-syntax">function_body_request</span><span class="plain-syntax">, </span><span class="identifier-syntax">css</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">function_bodies_to_compile</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">LOGIF</span><span class="plain-syntax">(</span><span class="identifier-syntax">SCHEMA_COMPILATION</span><span class="plain-syntax">, </span><span class="string-syntax">"=======\n\nFunction (%S) len %d: '%S'\n\n"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">InterPackage::name</span><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">block_package</span><span class="plain-syntax">), </span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">body</span><span class="plain-syntax">), </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">body</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Provenance::is_somewhere</span><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">provenance</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">LOGIF</span><span class="plain-syntax">(</span><span class="identifier-syntax">SCHEMA_COMPILATION</span><span class="plain-syntax">, </span><span class="string-syntax">"Function provenance %f, line %d\n\n"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">Provenance::get_filename</span><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">provenance</span><span class="plain-syntax">),</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">Provenance::get_line</span><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">provenance</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_schema</span><span class="plain-syntax"> *</span><span class="identifier-syntax">sch</span><span class="plain-syntax"> = </span><span class="identifier-syntax">ParsingSchemas::from_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">body</span><span class="plain-syntax">, </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">provenance</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">LinkedLists::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">sch</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">parsing_errors</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><a href="3-css.html#SP15" class="function-link"><span class="function-syntax">CompileSplatsStage::report_kit_errors</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">sch</span><span class="plain-syntax">, </span><span class="identifier-syntax">req</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Log::aspect_switched_on</span><span class="plain-syntax">(</span><span class="identifier-syntax">SCHEMA_COMPILATION_DA</span><span class="plain-syntax">)) </span><span class="identifier-syntax">InterSchemas::log</span><span class="plain-syntax">(</span><span class="identifier-syntax">DL</span><span class="plain-syntax">, </span><span class="identifier-syntax">sch</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="named-paragraph-container code-font"><a href="3-css.html#SP14_1" class="named-paragraph-link"><span class="named-paragraph">Compile this function body</span><span class="named-paragraph-number">14.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">LinkedLists::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">sch</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">parsing_errors</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="identifier-syntax">errors_occurred</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">errors_occurred</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP14_1" class="paragraph-anchor"></a><b>&#167;14.1. </b>And then we emit Inter code equivalent to <span class="extract"><span class="extract-syntax">sch</span></span>:
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Compile this function body</span><span class="named-paragraph-number">14.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">Produce::set_function</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">block_package</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Packaging::set_state</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, &amp;(</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">position</span><span class="plain-syntax">), </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">enclosure</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Produce::push_new_code_position</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, &amp;(</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">position</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">value_holster</span><span class="plain-syntax"> </span><span class="identifier-syntax">VH</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Holsters::new</span><span class="plain-syntax">(</span><span class="identifier-syntax">INTER_VOID_VHMODE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbols_table</span><span class="plain-syntax"> *</span><span class="identifier-syntax">scope1</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterPackage::scope</span><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">block_package</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">module_pack</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">step</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">pipeline</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">ephemera</span><span class="plain-syntax">.</span><span class="element-syntax">assimilation_modules</span><span class="plain-syntax">[</span><span class="identifier-syntax">step</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">tree_argument</span><span class="plain-syntax">];</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbols_table</span><span class="plain-syntax"> *</span><span class="identifier-syntax">scope2</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterPackage::scope</span><span class="plain-syntax">(</span><span class="identifier-syntax">module_pack</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">identifier_finder</span><span class="plain-syntax"> </span><span class="identifier-syntax">finder</span><span class="plain-syntax"> = </span><span class="identifier-syntax">IdentifierFinders::common_names_only</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IdentifierFinders::next_priority</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">finder</span><span class="plain-syntax">, </span><span class="identifier-syntax">scope1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IdentifierFinders::next_priority</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">finder</span><span class="plain-syntax">, </span><span class="identifier-syntax">scope2</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IdentifierFinders::set_namespace</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">finder</span><span class="plain-syntax">, </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">namespace</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Produce::provenance</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">provenance</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">EmitInterSchemas::emit</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">VH</span><span class="plain-syntax">, </span><span class="identifier-syntax">sch</span><span class="plain-syntax">, </span><span class="identifier-syntax">finder</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Produce::provenance</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">Provenance::nowhere</span><span class="plain-syntax">());</span>
<span class="plain-syntax">    </span><a href="3-css.html#SP15" class="function-link"><span class="function-syntax">CompileSplatsStage::report_kit_errors</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">sch</span><span class="plain-syntax">, </span><span class="identifier-syntax">req</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Produce::pop_code_position</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Produce::set_function</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="3-css.html#SP14">&#167;14</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP15" class="paragraph-anchor"></a><b>&#167;15. </b>Either parsing or emitting can throw errors, so at both stages:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">CompileSplatsStage::report_kit_errors</span><button class="popup" onclick="togglePopup('usagePopup16')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup16">Usage of <span class="code-font"><span class="function-syntax">CompileSplatsStage::report_kit_errors</span></span>:<br/><a href="3-css.html#SP14">&#167;14</a>, <a href="3-css.html#SP14_1">&#167;14.1</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_schema</span><span class="plain-syntax"> *</span><span class="identifier-syntax">sch</span><span class="plain-syntax">, </span><span class="reserved-syntax">function_body_request</span><span class="plain-syntax"> *</span><span class="identifier-syntax">req</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">LinkedLists::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">sch</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">parsing_errors</span><span class="plain-syntax">) &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">schema_parsing_error</span><span class="plain-syntax"> *</span><span class="identifier-syntax">err</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">LOOP_OVER_LINKED_LIST</span><span class="plain-syntax">(</span><span class="identifier-syntax">err</span><span class="plain-syntax">, </span><span class="identifier-syntax">schema_parsing_error</span><span class="plain-syntax">, </span><span class="identifier-syntax">sch</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">parsing_errors</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">I6Errors::set_current_location</span><span class="plain-syntax">(</span><span class="identifier-syntax">err</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">provenance</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">msg</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">msg</span><span class="plain-syntax">, </span><span class="string-syntax">"in function '%S': %S"</span><span class="plain-syntax">, </span><span class="identifier-syntax">req</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">identifier</span><span class="plain-syntax">, </span><span class="identifier-syntax">err</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">message</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">I6Errors::issue</span><span class="plain-syntax">(</span><span class="string-syntax">"Inform 6 syntax error %S"</span><span class="plain-syntax">, </span><span class="identifier-syntax">msg</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">msg</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">I6Errors::clear_current_location</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">}</span>
</pre>
<nav role="progress"><div class="progresscontainer">
    <ul class="progressbar"><li class="progressprev"><a href="3-rccs.html">&#10094;</a></li><li class="progresschapter"><a href="P-wtmd.html">P</a></li><li class="progresschapter"><a href="1-pm.html">1</a></li><li class="progresschapter"><a href="2-pp.html">2</a></li><li class="progresscurrentchapter">3</li><li class="progresssection"><a href="3-ps.html">ps</a></li><li class="progresssection"><a href="3-rccs.html">rccs</a></li><li class="progresscurrent">css</li><li class="progresschapter"><a href="4-lbks.html">4</a></li><li class="progresschapter"><a href="5-msms.html">5</a></li><li class="progresschapter"><a href="6-erms.html">6</a></li><li class="progressnext"><a href="4-lbks.html">&#10095;</a></li></ul></div>
</nav><!-- End of weave -->

		</main>
	</body>
</html>

